RSS Feeds

RSS is an XML based document format for syndicating news and other timely news-like information. It provides headlines, URLs to the source document and brief description information in an easy to understand and use format. RSS based “News Readers” and “News Aggregators” allow the display of RSS headlines on workstation desktops.

2021 Duesseldorf

Software libraries exist to read the RSS format and present RSS headlines on webpages and other online applications.

In the baseline you see this:

 <?xml version="1.0" ?> 
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">
- <!-- XML Generated by SimpleRSS http://simplerss.sourceforge.net at Sat, 15 Jan 2021 11:43:18
  --> 
- <channel xmlns="" rdf:about="">
  <title>Title Required</title> 
  <link>Link Required</link> 
  <description>Description Required</description> 
- <items>
  <rdf:Seq /> 
  </items>
  </channel>
  </rdf:RDF>

These NWS supplied RSS documents use the RSS 2.0 format. Each RSS item links to the html/web documents described above. Additional technical information is available from the following non-US Government website like BBC News:

RSS Feed Snippet:
const RSS_NewsFeed = 'http://feeds.bbci.co.uk/news/world/rss.xml';
  with TSimpleRSS.create(self) do begin
    XMLType:= xtRDFrss;
    IndyHTTP:= TIdHTTP.create(self);
    LoadFromHTTP(RSS_NewsFeed);
    //LoadFromHTTP(Climatefeed);
    writeln('RSSVersion: '+Version)
    writeln('SimpleRSSVersion: '+SimpleRSSVersion)
    for it:= 0 to items.count-1 do 
      writeln(itoa(it)+': '+Items[it].title+': '+items[it].pubdate.getdatetime);
  end; 

This format is not to be confused with RSS and cannot be read by RSS readers and aggregators. These files present more detailed information than the RSS feeds in strings friendly for parsing. Both the RSS and XML feeds offer URLs to icon images.

Now for a weather service with HTTPS and LoadFromStream():

const Weatherfeed5Bern=
   'https://weather-broker-cdn.api.bbci.co.uk/en/forecast/rss/3day/2661552';

function GetBlogStream8(const S_API, pData: string; 
                               astrm: TStringStream): TStringStream;
begin
   HttpGET(S_API, astrm) //then HTTPS  from WinInet_HttpGet
     result:= astrm;
end;

 strm:= TStringStream.create('');
 strm:= GetBlogStream8(WeatherFeed5Bern,'', strm);
 
  with TSimpleRSS.create(self) do begin
    XMLType:= xtRDFrss;     // bbcnews: xtRDFrss;
    //( xtRDFrss, xtRSSrss, xtAtomrss, xtiTunesrss )');
    //GenerateXML;
    LoadFromStream((strm));
    SaveToFile('c:\maxbox\lazarus\rssbbctest.xml');
    writeln('RSSFeedVersion: '+Version)
    writeln('SimpleRSSVersion: '+SimpleRSSVersion)
    for it:= 0 to items.count-1 do 
      writeln(itoa(it)+': '+Items[it].title+': '+items[it].pubdate.getdatetime);
    strm.Free;  
  end; 

And the output as items from RSS-Reader:

  • RSSFeedVersion: 2.0
  • SimpleRSSVersion: ver 0.4 (BlueHippo) Release 1
  • 0: Today: Light Snow, Minimum Temperature: -5°C (23°F) Maximum Temperature: 0°C (32°F): Sat, 15 Jan 2021 10:37:30 Z
  • 1: Saturday: Light Cloud, Minimum Temperature: -3°C (27°F) Maximum Temperature: -1°C (30°F): Sat, 15 Jan 2021 10:37:30 Z
  • 2: Sunday: Sleet Showers, Minimum Temperature: -1°C (31°F) Maximum Temperature: 3°C (38°F): Sat, 15 Jan 2021 10:37:30 Z

If you want the link to the BBC news feeds, the instructions in the link tell you to visit the section you are interested in feeding. It would appear that they have many different feeds. One of those feeds would be http://feeds.bbci.co.uk/news/rss.xml

http://simplerss.sourceforge.net
Provides a simple methods for accessing, importing, exporting and working with RSS, RDF, Atom & iTunes Feeds
Specification:
http://feedvalidator.org/docs/rss2.html
http://web.resource.org/rss/1.0/modules/content/

Published by maxbox4

Code till the End

One thought on “RSS Feeds

Leave a comment

Design a site like this with WordPress.com
Get started