feedManager is the primary interface used for reading and parsing website RSS and content feeds. It can handle auto-detection of the feed type and will return a feedChannel object that represents the feed.
feedManager can be used optionally with the cacheController for feed caching.
feedManager supports RSS1/2 and Atom feeds. Additional types can be added by updating the ReaderMap array and implementing a new reader.
Example usage:
$oFeed = feedManager::getInstance()->fetch('http://www.theregister.co.uk/headlines.atom');
foreach ( $oFeed->getItemSet() as $oFeedItem ) {
// do something...
echo $oFeedItem->getTitle(), '';
}
$oCacheWriter = new cacheWriterFile(system::getConfig()->getPathTemp().'/feeds');
$oCacheWriter->setUseSubFolders(false);
feedManager::setCache(new cacheController($oCacheWriter));
$oFeed = feedManager::getInstance()->fetch('http://www.theregister.co.uk/headlines.atom');
foreach ( $oFeed->getItemSet() as $oFeedItem ) {
// do something...
echo $oFeedItem->getTitle(), '';
}
public static getInstance()
Returns a new instance of the feedManager
public static setCache($inCache)
Set the cacheController
public static getCache()
Returns the cacheController instance
public static hasCache()
Returns true if a cacheController instance has been set
public fetch($inUri, [$inType = 'auto'])
Fetches the feed specified in $inURI and returns a feedChannel object
public detectType()
Detects the type of feed
public parseFeed()
Creates the appropriate parser for the feed, and parses the feed
public getDomDocument()
Returns $_DomDocument
public setDomDocument($inDomDocument)
Set $_DomDocument to $inDomDocument
public getFeedUri()
Returns $_FeedUri
public setFeedUri($inFeedUri)
Set $_FeedUri to $inFeedUri
public getFeedType()
Returns $_FeedType
public setFeedType($inFeedType)
Set $_FeedType to $inFeedType
Posted by: Scorpio Documentor (Writer), in Feed on 19 Nov 2009 @ 20:30
Tags: feed, feedmanager,
This
work is licenced under a
Creative Commons Licence.