This repository has been archived by the owner on Jul 24, 2018. It is now read-only.
DwApiRss
pritaeas edited this page Apr 25, 2013
·
22 revisions
Class to get (filtered) RSS feeds.
Restrictions set by DaniWeb: the feed is cached, it will not contain over 100 articles, and articles will be no older than 90 days.
Read more about common exceptions.
Returns the RSS feed, optionally filtered by forum ID and/or RSS article type.
Parameters
$forumId int Forum ID (optional).
$articleType string RSS article type (optional).
Exceptions
DwApiException EX_INVALID_INT Invalid forum ID.
DwApiException EX_INVALID_TYPE_RSS_ARTICLE Invalid RSS article type.
Return value
string RSS feed.
See also
include 'DwApiRss.class.php';
$dwApi = new DwApiRss();
try
{
$siteFeed = $dwApi->GetFeed(); // site feed
$phpFeed = $dwApi->GetFeed(17); // PHP forum feed
$siteNewsFeed = $dwApi->GetFeed(null, 'news'); // news articles feed
$phpCodeFeed = $dwApi->GetFeed(17, 'code'); // PHP forum code snippets feed
}
catch (DwApiException $exception)
{
die($exception->getMessage());
}