Bundle RSS feed reader. RSSReader fetches and parses RSS 2.0 feeds from a URL or string; RSSChannel and RSSPost expose title, description, link, and publication date. Compile with -lib rss.
RSSReader
Reader for RSS feeds
Operations
GetChannel #
Get RSS channel meta data
method : public : GetChannel() ~ RSSChannelReturn
| Type | Description |
|---|---|
| RSSChannel | RSS meta data |
Example
reader := RSSReader->New("https://feeds.bbci.co.uk/news/rss.xml");
if(reader->IsOk()) {
channel := reader->GetChannel();
channel->GetTitle()->PrintLine();
channel->GetLink()->PrintLine();
};GetPosts #
Get RSS posts
method : public : GetPosts() ~ Vector<RSSPost>Return
| Type | Description |
|---|---|
| Vector<RSSPost> | RSS posts |
Example
reader := RSSReader->New("https://feeds.bbci.co.uk/news/rss.xml");
if(reader->IsOk()) {
each(post := reader->GetPosts()) {
post->GetTitle()->PrintLine();
};
};IsOk #
Checks to see if RSS XML was successfully retrieved and parsed
method : public : IsOk() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if success, false otherwise |
Example
reader := RSSReader->New("https://feeds.bbci.co.uk/news/rss.xml");
if(reader->IsOk()) {
"Feed loaded successfully"->PrintLine();
} else {
"Failed to load feed"->PrintLine();
};