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
(PowerBuilder) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
integer li_rc oleobject loo_Rss integer li_Success oleobject loo_RssChannel integer li_NumItems integer i oleobject loo_RssItem integer li_NumCategories integer j loo_Rss = create oleobject // Use "Chilkat_9_5_0.Rss" for versions of Chilkat < 10.0.0 li_rc = loo_Rss.ConnectToNewObject("Chilkat.Rss") if li_rc < 0 then destroy loo_Rss MessageBox("Error","Connecting to COM object failed") return end if // Download from the feed URL: li_Success = loo_Rss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") if li_Success <> 1 then Write-Debug loo_Rss.LastErrorText destroy loo_Rss return end if // Get the 1st channel. loo_RssChannel = loo_Rss.GetChannel(0) if loo_Rss.LastMethodSuccess = 0 then Write-Debug "No channel found in RSS feed." destroy loo_Rss return end if // Display the various pieces of information about the channel: Write-Debug "Title: " + loo_RssChannel.GetString("title") Write-Debug "Link: " + loo_RssChannel.GetString("link") Write-Debug "Description: " + loo_RssChannel.GetString("description") // For each item in the channel, display the title, link, // publish date, and categories assigned to the post. li_NumItems = loo_RssChannel.NumItems for i = 0 to li_NumItems - 1 loo_RssItem = loo_RssChannel.GetItem(i) Write-Debug "----" Write-Debug "Title: " + loo_RssItem.GetString("title") Write-Debug "Link: " + loo_RssItem.GetString("link") Write-Debug "pubDate: " + loo_RssItem.GetString("pubDate") li_NumCategories = loo_RssItem.GetCount("category") if li_NumCategories > 0 then for j = 0 to li_NumCategories - 1 Write-Debug " category: " + loo_RssItem.MGetString("category",j) next end if destroy loo_RssItem next destroy loo_RssChannel destroy loo_Rss |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.