Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Excel) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
Dim rss As Chilkat.Rss Set rss = Chilkat.NewRss ' Download from the feed URL: success = rss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") If (success <> True) Then Debug.Print rss.LastErrorText Exit Sub End If ' Get the 1st channel. Set rssChannel = rss.GetChannel(0) If (rss.LastMethodSuccess = False) Then Debug.Print "No channel found in RSS feed." Exit Sub End If ' Display the various pieces of information about the channel: Debug.Print "Title: "; rssChannel.GetString("title") Debug.Print "Link: "; rssChannel.GetString("link") Debug.Print "Description: "; rssChannel.GetString("description") ' For each item in the channel, display the title, link, ' publish date, and categories assigned to the post. numItems = rssChannel.NumItems For i = 0 To numItems - 1 Set rssItem = rssChannel.GetItem(i) Debug.Print "----" Debug.Print "Title: "; rssItem.GetString("title") Debug.Print "Link: "; rssItem.GetString("link") Debug.Print "pubDate: "; rssItem.GetString("pubDate") numCategories = rssItem.GetCount("category") If (numCategories > 0) Then For j = 0 To numCategories - 1 Debug.Print " category: "; rssItem.MGetString("category",j) Next End If Next |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.