User Tools

Site Tools


reading_20rss_20feeds

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

reading_20rss_20feeds [2018/03/31 13:19]
127.0.0.1 external edit
reading_20rss_20feeds [2018/04/17 18:30] (current)
tbest3112 Added syntax highlighting
Line 6: Line 6:
   * Extract the wanted information by parsing the contents of the XML file.   * Extract the wanted information by parsing the contents of the XML file.
 \\  Downloading the RSS data can easily be achieved by calling the function **PROCurldownload** which can be found [[/​Downloading%20a%20file%20from%20a%20URL|here]] (there are two versions of the procedure listed in that article; the second, longer, version may be more reliable). Extracting the wanted information from the file can be achieved by calling routines within the [[/​Libraries|XMLLIB library]].\\ \\  RSS data is **hierarchical**,​ and the structure of the data is reflected in the structure of the XML file. If you want to examine what data is available in a particular RSS feed you can adapt the program **xml2tree** (available [[http://​groups.yahoo.com/​group/​bb4w/​files/​WindowsAPI/​xml2tree.bbc|here]]) by changing the URL to that of the feed you are interested in; the program displays the data as a **Tree View**.\\ \\  Here is a typical example of the hierarchy of the parts of an RSS feed in which you are most likely to be interested:​\\ \\  \\  Downloading the RSS data can easily be achieved by calling the function **PROCurldownload** which can be found [[/​Downloading%20a%20file%20from%20a%20URL|here]] (there are two versions of the procedure listed in that article; the second, longer, version may be more reliable). Extracting the wanted information from the file can be achieved by calling routines within the [[/​Libraries|XMLLIB library]].\\ \\  RSS data is **hierarchical**,​ and the structure of the data is reflected in the structure of the XML file. If you want to examine what data is available in a particular RSS feed you can adapt the program **xml2tree** (available [[http://​groups.yahoo.com/​group/​bb4w/​files/​WindowsAPI/​xml2tree.bbc|here]]) by changing the URL to that of the feed you are interested in; the program displays the data as a **Tree View**.\\ \\  Here is a typical example of the hierarchy of the parts of an RSS feed in which you are most likely to be interested:​\\ \\ 
 +<​code>​
   <rss>   <rss>
     <​channel>​     <​channel>​
Line 17: Line 18:
         <​title>​         <​title>​
         <​description>​         <​description>​
 +</​code>​
 To illustrate the process of downloading,​ extracting and using the data two examples follow; both make use of RSS feeds provided by the BBC.\\ \\  To illustrate the process of downloading,​ extracting and using the data two examples follow; both make use of RSS feeds provided by the BBC.\\ \\ 
 ==== Weather example ==== ==== Weather example ====
 \\  The code below displays a summary of the weather forecast for the next three days (if you happen to live in Buckingham!):​\\ \\  \\  The code below displays a summary of the weather forecast for the next three days (if you happen to live in Buckingham!):​\\ \\ 
 +<code bb4w>
         INSTALL @lib$+"​XMLLIB"​         INSTALL @lib$+"​XMLLIB"​
  
Line 44: Line 47:
         PROC_exitXML(xml{})         PROC_exitXML(xml{})
         END         END
 +</​code>​
 If you want a more detailed forecast you can include the '​description'​ data as well as the '​title':​\\ \\  If you want a more detailed forecast you can include the '​description'​ data as well as the '​title':​\\ \\ 
 +<code bb4w>
         INSTALL @lib$+"​XMLLIB"​         INSTALL @lib$+"​XMLLIB"​
  
Line 72: Line 77:
         PROC_exitXML(xml{})         PROC_exitXML(xml{})
         END         END
 +</​code>​
 \\  \\ 
 ==== News example ==== ==== News example ====
 \\  The code below lists the news headlines:​\\ \\  \\  The code below lists the news headlines:​\\ \\ 
 +<code bb4w>
         INSTALL @lib$+"​XMLLIB"​         INSTALL @lib$+"​XMLLIB"​
  
Line 97: Line 104:
         PROC_exitXML(xml{})         PROC_exitXML(xml{})
         END         END
 +</​code>​
 VDU 14 is used to pause the display at the end of each page until **Shift** is pressed. VDU 14 is used to pause the display at the end of each page until **Shift** is pressed.
reading_20rss_20feeds.txt ยท Last modified: 2018/04/17 18:30 by tbest3112