Grouper: RSS manager, XML converter, website scraper
Web This Site

Grouper - Documentation


Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes
Etc.: Configure | Affiliates

Miscellaneous:

Use the function "GrouperConf" to set the options listed on this page.



contenttype
Sets the MIME type for Grouper's output. The default value is the MIME type for RSS 2.0 ("application/rss+xml"). If you do not want Grouper to output a Content-Type header, set this to '' (blank).

Example: (set the content type to "text/xml")
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('contenttype','text/xml');
GrouperShow('cuisine');
?>



encoding-in: [Grouper >= 1.6.2]
This setting is an array with one member, indexed by the key 'request' (ie. $grouperconf['encoding-in']['request']). (Additional values may be added to the array by Grouper during processing). The value of the "request" member indicates the desired encoding (eg. "UTF-8", "ISO-8859-1", etc.) when used with a data source that supports requesting a specific encoding. To set this option, use code like this:

Example: (request search results in "ISO-8859-1")
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('request','ISO-8859-1','encoding-in'); GrouperShow('cuisine');
?>



encoding-priority: [Grouper >= 1.6.2]
This setting is an array indicating the order of priorities in which to select the input document encoding. By default, the encoding specified by the document is used, if any, followed by the encoding indicated in the HTTP headers if any, and finally if neither of those is found, the value of $grouperconf['encoding-in']['request'] is used. Note that internet standards specify that the HTTP header value should take precedence. However, in practice, the document may be correct more often. If you encounter a feed where the document specifies the encoding incorrectly, you will need to adjust the order of precedence here.

Example: (use the header-specified encoding first)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
$groupconf['encoding-priority']=array('header','document','request'));
GrouperShow('cuisine');
?>



encoding-out [Grouper Evolution >= 1.6.2]
If you wish to have the feed transcoded from the encoding of the source data to some other encoding, specify the desired encoding here. If this is left blank, the feed will use the same encoding as the input data. (Requires iconv support on your server in most cases).

Example: (output the feed in Shift_JIS--a Japanese encoding)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('encoding-out','Shift_JIS');
GrouperShow('cuisine');
?>



groupererrors
Set to 2 to have Grouper display error messages as links to pages in the documentation that suggest solutions (the default), 1 to have Grouper display them but not as links, or 0 to suppress them. Note that this setting does not affect the display of PHP errors. Use the following setting for that.

Example: (do not display Grouper errors)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('groupererrors',0);
GrouperShow('cuisine');
?>



phperrors
Set to -1 to leave PHP's error reporting setting as it is. Otherwise, indicate the value you desire for error reporting. 0 = no errors. For other values, refer to the PHP documentation. When using predefined PHP constants, be sure not NOT to put quote marks around the values.

Example: (show all errors, warnings, notices, etc.--useful for debugging)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('phperrors',E_ALL);
GrouperShow('cuisine');
?>



source
Selects the news source to search. Valid values for the free version of Grouper are: 'google', 'yahoo', 'feedster', and 'daypop'. With Grouper Evolution, GrouperLoadPlugin('<desired source name>.php'); does the same thing.

Example: (search Yahoo! News)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('source','yahoo');
GrouperShow('cuisine');
?>



maxitems
The maximum number of items to output. This setting does not work with all sources.

Example: (output at most 5 items in the feed)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperLoadPlugin('xml.php');
GrouperLoadPlugin('xml-atom-1.0.php');
GrouperSourceURL('http://example.com/feed.atom');
GrouperConf('maxitems',5);
GrouperShow('cuisine');
?>



skipdups: Skip duplicate news items based on the headline. This feature is only supported in Grouper Evolution, and only with scraper code that uses the default extraction method.

Example: (don't attempt to skip duplicate items)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperLoadPlugin('my-custom-scraper-plugin.php');
GrouperConf('skipdups',0);
GrouperShow('cuisine');
?>



useragent: Set the User-Agent HTTP header to pretend to be some other application.

Example: (pretend to be Mozilla/5.0)
<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperConf('useragent','Mozilla/5.0');
GrouperShow('cuisine');
?>