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
(C# UWP/WinRT) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
Chilkat.Rss rss = new Chilkat.Rss(); // Download from the feed URL: bool success = await rss.DownloadRssAsync("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"); if (success != true) { Debug.WriteLine(rss.LastErrorText); return; } // Get the 1st channel. Chilkat.Rss rssChannel = rss.GetChannel(0); if (rss.LastMethodSuccess == false) { Debug.WriteLine("No channel found in RSS feed."); return; } // 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. int numItems = rssChannel.NumItems; int i; for (i = 0; i <= numItems - 1; i++) { Chilkat.Rss rssItem = rssChannel.GetItem(i); Debug.WriteLine("----"); Debug.WriteLine("Title: " + rssItem.GetString("title")); Debug.WriteLine("Link: " + rssItem.GetString("link")); Debug.WriteLine("pubDate: " + rssItem.GetString("pubDate")); int numCategories = rssItem.GetCount("category"); int j; if (numCategories > 0) { for (j = 0; j <= numCategories - 1; j++) { Debug.WriteLine(" category: " + rssItem.MGetString("category",j)); } } } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.