Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
LOCAL loRss LOCAL lnSuccess LOCAL loRssChannel LOCAL lnNumItems LOCAL i LOCAL loRssItem LOCAL lnNumCategories LOCAL j * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Rss') loRss = CreateObject('Chilkat.Rss') * Download from the feed URL: lnSuccess = loRss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") IF (lnSuccess <> 1) THEN ? loRss.LastErrorText RELEASE loRss CANCEL ENDIF * Get the 1st channel. loRssChannel = loRss.GetChannel(0) IF (loRss.LastMethodSuccess = 0) THEN ? "No channel found in RSS feed." RELEASE loRss CANCEL ENDIF * Display the various pieces of information about the channel: ? "Title: " + loRssChannel.GetString("title") ? "Link: " + loRssChannel.GetString("link") ? "Description: " + loRssChannel.GetString("description") * For each item in the channel, display the title, link, * publish date, and categories assigned to the post. lnNumItems = loRssChannel.NumItems FOR i = 0 TO lnNumItems - 1 loRssItem = loRssChannel.GetItem(i) ? "----" ? "Title: " + loRssItem.GetString("title") ? "Link: " + loRssItem.GetString("link") ? "pubDate: " + loRssItem.GetString("pubDate") lnNumCategories = loRssItem.GetCount("category") IF (lnNumCategories > 0) THEN FOR j = 0 TO lnNumCategories - 1 ? " category: " + loRssItem.MGetString("category",j) NEXT ENDIF RELEASE loRssItem NEXT RELEASE loRssChannel RELEASE loRss |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.