|
CWIS Developer Documentation
|
Implements an RSS client for fetching, parsing, and caching RSS feeds. More...
Public Member Functions | |
| __construct ($ServerUrl, $CacheDB=NULL, $RefreshTime=600, $Encoding="UTF-8", $DebugLevel=0) | |
| Object constructor. More... | |
| ServerUrl ($NewValue=NULL) | |
| Get or set the RSS feed URL. More... | |
| Encoding ($NewValue=NULL) | |
| Get or set the character encoding of the RSS feed. More... | |
| AutodetectEncoding () | |
| Try to automatically detect and set the encoding of the RSS feed. More... | |
| GetItems ($NumberOfItems=NULL, $ChannelName=NULL) | |
| Retrieve the RSS items from the RSS feed. More... | |
| GetChannelTitle () | |
| Retrieve the channel title as given in the RSS feed. More... | |
| GetChannelLink () | |
| Retrive the URL to the site of the channel in the RSS feed. More... | |
| GetChannelDescription () | |
| Get the description of the channel as given in the RSS feed. More... | |
| UsedCachedData () | |
| Determine whether the RSS client is using cached data. More... | |
Implements an RSS client for fetching, parsing, and caching RSS feeds.
Definition at line 13 of file RSSClient.php.
| RSSClient::__construct | ( | $ServerUrl, | |
$CacheDB = NULL, |
|||
$RefreshTime = 600, |
|||
$Encoding = "UTF-8", |
|||
$DebugLevel = 0 |
|||
| ) |
Object constructor.
| string | $ServerUrl | URL to the RSS feed. |
| Database | $CacheDB | Database object to use for storage and retrieval of cached RSS feeds. The default value is NULL. |
| int | $RefreshTime | Time in seconds for how long the cache of an RSS should remain valid. The default value is 600. |
| string | $Encoding | The character encoding of the RSS feed. The default value is UTF-8. |
| int | $DebugLevel | The level of verbosity of debug messages. The default value is 0. |
Definition at line 29 of file RSSClient.php.
References Encoding().
| RSSClient::AutodetectEncoding | ( | ) |
Try to automatically detect and set the encoding of the RSS feed.
The precedence is as follows: encoding declared in the XML file, charset parameter in the Content-Type HTTP response header, then ISO-8859-1.
Definition at line 128 of file RSSClient.php.
References Encoding(), and ServerUrl().
| RSSClient::Encoding | ( | $NewValue = NULL | ) |
Get or set the character encoding of the RSS feed.
| string | $NewValue | New character encoding of the RSS feed. This parameter is optional. |
Definition at line 96 of file RSSClient.php.
References ServerUrl().
Referenced by __construct(), and AutodetectEncoding().

| RSSClient::GetChannelDescription | ( | ) |
Get the description of the channel as given in the RSS feed.
Definition at line 256 of file RSSClient.php.
| RSSClient::GetChannelLink | ( | ) |
Retrive the URL to the site of the channel in the RSS feed.
Definition at line 246 of file RSSClient.php.
| RSSClient::GetChannelTitle | ( | ) |
Retrieve the channel title as given in the RSS feed.
Definition at line 236 of file RSSClient.php.
| RSSClient::GetItems | ( | $NumberOfItems = NULL, |
|
$ChannelName = NULL |
|||
| ) |
Retrieve the RSS items from the RSS feed.
The first channel of the feed will be used if not specified.
| int | $NumberOfItems | Number of items to return from the field. All of the items are returned by default. |
| string | $ChannelName | Channel to retrieve if not the first one. |
Definition at line 190 of file RSSClient.php.
References $Items.
| RSSClient::ServerUrl | ( | $NewValue = NULL | ) |
Get or set the RSS feed URL.
| string | $NewValue | New RSS feed URL. This parameter is optional. |
Definition at line 63 of file RSSClient.php.
Referenced by AutodetectEncoding(), Encoding(), and UsedCachedData().

| RSSClient::UsedCachedData | ( | ) |
Determine whether the RSS client is using cached data.
Definition at line 266 of file RSSClient.php.
References ServerUrl().