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

Function Reference

GrouperCacheData(URL, cachefile);
Grouper >= 1.6

Fetches data and stores it, unmodified, in a local cache file. If the cache file already exists, it is refreshed only if it is older than the number of minutes specified in the cacheinterval configuration setting. This function returns 1 if it was necessary to refresh the cache, and 0 if not. After this function completes, $grouperconf['mtime'] will contain the UNIX timestamp for the last time the cache was updated. This function is for use with non-search sources (XML plugins, scraper plugins, etc.) For search sources, use GrouperSearch instead.

URL: The address of the document to be processed by Grouper. The name of a cache file may be specified by entering "grouper:cache-name".
cachefile: The filename of the local cache file or database key if using mySQL caching.



Example: (cache a copy of an Atom feed--then convert it to RSS, store the RSS data in a file named "example.rss", and output it)

<?php
require_once '/YOUR/PATH/TO/grouper/grouper.php';
GrouperCacheData('http://example.com/feed.atom','example.atom');
GrouperLoadPlugin('xml.php');
GrouperLoadPlugin('xml-atom-1.0.php');
GrouperConvert('grouper:example.atom','example.rss',1);
?>