Option Public Option Explicit Use "UrlFetcherLS" Use "XmlNodeReader" Sub Initialize Dim rssUrl As String Dim fetcher As New UrlFetcher Dim response As String '** use a UrlFetcher to retrieve an RSS feed. See '** http://www.nsftools.com/blog/blog-05-2007.htm#05-22-07 rssUrl = "http://www.nsftools.com/blog/blog.rss" response = fetcher.getUrlAsString( rssUrl ) If (Len(fetcher.getLastError()) > 0) Then Messagebox "Error getting RSS feed: " + fetcher.getLastError() Exit Sub End If '** read the feed into an XmlNodeReader Dim reader As New XmlNodeReader Call reader.ReadText( response ) If reader.isEmpty Then Messagebox "Error parsing RSS feed: " & reader.getLastError() Exit Sub End If '** print the feed title and link Print "RSS Title = " & reader.get( "rss.channel.title" ) Print "Blog Link = " & reader.get( "rss.channel.link" ) '** iterate through all the <item> nodes and print their title and link Dim arr As Variant Dim i As Integer arr = reader.getNodeReaders("rss.channel.item") For i = 0 To Ubound(arr) Print "Feed Item #" & i+1 & " Title = " & arr(i).get( "title" ) Print "Feed Item #" & i+1 & " Link = " & arr(i).get( "link" ) Next End Sub
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.