CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
RSSClient Class Reference

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...

## Detailed Description

Implements an RSS client for fetching, parsing, and caching RSS feeds.

Definition at line 13 of file RSSClient.php.

## Constructor & Destructor Documentation

RSSClient::__construct | ( |  | $ServerUrl,
|  |  | $CacheDB = `NULL`,
|  |  | $RefreshTime = `600`,
|  |  | $Encoding = `"UTF-8"`,
|  |  | $DebugLevel = `0`
| ) |  |

Object constructor.

Parameters

  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().

## Member Function Documentation

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 131 of file RSSClient.php.

References Encoding(), and ServerUrl().

RSSClient::Encoding | ( |  | $NewValue = `NULL` | ) |

Get or set the character encoding of the RSS feed.

Parameters

  string | $NewValue | New character encoding of the RSS feed. This parameter is optional.

Returns
  Returns the current character encoding of the RSS feed.

Definition at line 99 of file RSSClient.php.

References ServerUrl().

Referenced by __construct(), and AutodetectEncoding().

Here is the caller graph for this function:

RSSClient::GetChannelDescription | ( |  | ) |

Get the description of the channel as given in the RSS feed.

Returns
  Returns the description of the channel as given in the RSS feed.

Definition at line 259 of file RSSClient.php.

RSSClient::GetChannelLink | ( |  | ) |

Retrive the URL to the site of the channel in the RSS feed.

Returns
  Returns the URL to the site of the channel in the RSS feed.

Definition at line 249 of file RSSClient.php.

RSSClient::GetChannelTitle | ( |  | ) |

Retrieve the channel title as given in the RSS feed.

Returns
  Returns the channel title.

Definition at line 239 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.

Parameters

  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.

Returns
  Returns the items from the RSS feed.

Definition at line 193 of file RSSClient.php.

References $Items.

RSSClient::ServerUrl | ( |  | $NewValue = `NULL` | ) |

Get or set the RSS feed URL.

Parameters

  string | $NewValue | New RSS feed URL. This parameter is optional.

Returns
  Returns the current RSS feed URL.

Definition at line 66 of file RSSClient.php.

Referenced by AutodetectEncoding(), Encoding(), and UsedCachedData().

Here is the caller graph for this function:

RSSClient::UsedCachedData | ( |  | ) |

Determine whether the RSS client is using cached data.

Returns
  Returns TRUE if the RSS client is using cached data.

Definition at line 269 of file RSSClient.php.

References ServerUrl().

The documentation for this class was generated from the following file:

- lib/ScoutLib/RSSClient.php