Grouper - Documentation
Getting Started: Free Download |
Purchase |
Install
Reference: Functions | Plugins | Themes
Etc.: Configure | Affiliates
Reference: Functions | Plugins | Themes
Etc.: Configure | Affiliates
Function Reference
GrouperSearch(searchterms [, cachefile [, showit]]);
Grouper >= 1.6
Fetches an RSS newsfeed from the internet or a cache file and outputs it according to any settings you may have specified. If a cache file was specified, the PHP variable $grouperconf['mtime'] will contain the UNIX timestamp for the last time the cache was updated after this function is called. This function is for use with search sources only. For other plugins, use the function GrouperConvert instead.
searchterms: The terms you would like to search for.
cachefile: The filename of the cache file in which to store a copy of Grouper's output. If this argument is omitted, no cache file is used, and the data is re-retrieved every time. We recommend only doing this while working on the configuration (unless using GrouperCache to maintain a local copy of the data or using a local file as the data source). Once you have finalized your settings, you will see significantly faster performance by specifying a cache file.
showit: If you set this argument to 0, GrouperSearch will generate or update the specified cache file, but will not display any data.
Example: (search Google News for "cuisine", and store output in a file named "google-cuisine", and output the RSS data)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperSearch('cuisine','google-cuisine');
?>
Example: (search Google News for "cuisine", and store output in a file named "google-cuisine" -- then use CaRP to display it as HTML)
<html>
<head>
<title>This is the page title</title>
</head>
<body>
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperSearch('cuisine','google-cuisine',0);
require_once '/YOUR/PATH/TO/carp/carp.php';
CarpShow('grouper:google-cuisine');
?>
</body>
</html>
NOTE: For CaRP versions before 3.5.10, the CarpShow line must be as follows:
CarpShow('/YOUR/PATH/TO/grouper/rsscache/google-cuisine');