![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(VB.NET) Read RSS FeedNote: This example uses classes, properties, or methods discontinued in Chilkat v11.0.0 or greater. Sample code showing how to read an RSS feed and emit the contents.
Dim rss As New Chilkat.Rss ' Download from the feed URL: Dim success As Boolean = rss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") If (success <> True) Then Debug.WriteLine(rss.LastErrorText) Exit Sub End If ' Get the 1st channel. Dim rssChannel As Chilkat.Rss = rss.GetChannel(0) If (rss.LastMethodSuccess = False) Then Debug.WriteLine("No channel found in RSS feed.") Exit Sub End If ' Display the various pieces of information about the channel: Debug.WriteLine("Title: " & rssChannel.GetString("title")) Debug.WriteLine("Link: " & rssChannel.GetString("link")) Debug.WriteLine("Description: " & rssChannel.GetString("description")) ' For each item in the channel, display the title, link, ' publish date, and categories assigned to the post. Dim numItems As Integer = rssChannel.NumItems Dim i As Integer For i = 0 To numItems - 1 Dim rssItem As Chilkat.Rss = rssChannel.GetItem(i) Debug.WriteLine("----") Debug.WriteLine("Title: " & rssItem.GetString("title")) Debug.WriteLine("Link: " & rssItem.GetString("link")) Debug.WriteLine("pubDate: " & rssItem.GetString("pubDate")) Dim numCategories As Integer = rssItem.GetCount("category") Dim j As Integer If (numCategories > 0) Then For j = 0 To numCategories - 1 Debug.WriteLine(" category: " & rssItem.MGetString("category",j)) Next End If Next |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.