Grouper: Convert web pages and news searches to RSS XML Plugin for Grouper Evolution
The extendable version of Grouper
 
XML is a plugin bundled with Grouper Evolution which converts files from other XML formats to RSS. It comes with helper plugins for Atom versions 0.3 and 1.0, which set the necessary configuration settings and provide extra functions which are needed for processing Atom feeds.
 
Installation:
To install XML support, put xml.php, xml-atom-0.3.php, and xml-atom-1.0.php into the "plugins" folder inside the folder containing grouper.php.
 
Use:
To tell Grouper Evolution to use the XML plugin, enter commands like the following into your webpage after "require_once '/path/to/grouper.php';" (changing "antone.geckotribe.com" to the desired domain name and "/mentalarc/atom.xml" to the path to the XML file). Note that this example also loads the Atom 0.3 helper plugin. Grouper does not detect which version of feed it is reading, so if you're converting an Atom 1.0 feed, you'll need to change the code to load xml-atom-1.0.php instead. For other XML formats, you will need to do additional configuration similar to what the helper plugin does:
 
     GrouperLoadPlugin('xml.php');
     GrouperLoadPlugin('xml-atom-0.3.php');
     GrouperSourceURL('http://antone.geckotribe.com/mentalarc/atom.xml');

Note: if you are using Grouper version 1.4.2 or earlier, you must replace the last line above with the following lines.

     GrouperSourceConf('searchdomain','antone.geckotribe.com');
     GrouperSourceConf('querystart','/mentalarc/atom.xml');
 
Configuration:
The behavior of the XML plugin is configured using the function GrouperSourceConf, as follows:
     GrouperSourceConf('OptionNameFromBelow','new value');
 
XML has the following options:
  • searchdomain: The domain name of the server from which to load the XML file (for example, 'antone.geckotribe.com').
  • querystart: The path to the XML file. This value MUST begin with '/'.
  • encoding: The character encoding in which you wish Grouper to output the RSS feed. Valid value are UTF-8, ISO-8859-1, and US-ASCII.
  • mustparsedate: 1 if you wish to ensure that Grouper only outputs dates in a valid format. 0 to allow Grouper to pass any value through that it finds in the XML file, even if it is unable to convert it to a proper date.
  • auto-clean-up: 1 to have the XML plugin automatically do some necessary work to avoid memory leaks when it finishes processing. 0 to do it manually, allowing you access to the parsed XML data tree. Documentation for how to do this is not yet available.
  • cache-reconstituted: 1 to keep a cached copy of elements that have been rebuilt after being parsed. 0 to save memory by not doing so. Unless you wish to access the data manually after the plugin has finished processing, there is probably no need to do this.
  • encodingin: This setting is an array with one member, indexed by the value 'conf'. The value indicates the configuration-specified default encoding to assume if the encoding cannot be determined some other way. The plugin will add more values to this array during processing.
  • encoding-priority: 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, the value of $xmlgrouperconf['encodingin']['conf'] 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.
The following format-specific configuration settings are necessary if you wish to parse a format other than Atom. We recommend creating a plugin like the Atom plugin if you need to access data from other XML formats.
  • element-map:
  • inline-elements: