ReachRSS includes a powerful PHP class that allows you to tap into the capabilities of RSS without writting your own RSS engine / caching system.
While we fully encourage you to extend ReachRSS for your own purposes, please keep in mind that ReachRSS is a commercial product and unless you purchase a special redistribution license you are not permitted to distribute ReachRSS with your own code. You could, however, distribute your code seperately and require that the user obtain their own licensed copy of Reach!
The ReachRSS Class
The ReachRSS PHP Class is designed to allow you to programatically tap into the ReachRSS engine and perform any of the admin functions you could manage from the admin UI and more! Using this class you can keep your feeds up to date without tracking update times, cacheing results, and parsing RSS XML. All you need to do is create a ReachRSS class and call the functions you wish to use - Reach takes care of managing the RSS feeds and keeping them up to date.
The first thing you need to do in your PHP code is to include the reachrss.php file and create a new instance. You can do this with:
require_once("reachrss.php"); $ReachRSS = new ReachRSS();
This gives you a new object ($ReachRSS) to work with your RSS feeds. It's now highly recommended that you call one of the startup(), output(), or save() functions. Without calling one of these functions you will have to do everything manually.
Startup loads existing data, checks all existing channels, and updates any that need updating. To call Startup use:
Now your channels are all up to date and you're ready to manipulate the class in whatever way you like. You can skip to the function descriptions below if you like.
If however, you want to simply output the template to your browser or to a file, ReachRSS offers an easy way to do both of these things without having to bother with the Startup call or any other functions. Output calls Startup() automatically and then parses the template and outputs it to the browser. To call Output instead of Startup use:
Save does the same as output, but it sends the completed template to a filename you specify. To call Save instead of Startup or Output use:
There are several functions that you will commonly use to obtain data from your RSS feeds using Reach. Remember that ReachRSS handles multiple channels (RSS feeds) at the same time, so most functions require a "ChannelURL" property when requesting data. Without this Reach wouldn't know which channel you want information on.