Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
Read RSS FeedSample code showing how to read an RSS feed and display the contents. The Chilkat RSS class/component is freeware. Note: The Chilkat XML ActiveX also includes the Chilkat RSS and Atom components. LOCAL loRss LOCAL lnSuccess LOCAL loRssChannel LOCAL lnNumItems LOCAL i LOCAL loRssItem LOCAL lnNumCategories LOCAL j loRss = CreateObject('Chilkat.Rss') * Download from the feed URL: lnSuccess = loRss.DownloadRss("http://blog.chilkatsoft.com/?feed=rss2") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loRss.LastErrorText) QUIT ENDIF * Get the 1st channel. loRssChannel = loRss.GetChannel(0) IF (loRssChannel = NULL ) THEN =MESSAGEBOX("No channel found in RSS feed.") QUIT 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 |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser