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
(PowerShell) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll" $rss = New-Object Chilkat.Rss # Download from the feed URL: $success = $rss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") if ($success -ne $true) { $($rss.LastErrorText) exit } # Get the 1st channel. $rssChannel = $rss.GetChannel(0) if ($rss.LastMethodSuccess -eq $false) { $("No channel found in RSS feed.") exit } # Display the various pieces of information about the channel: $("Title: " + $rssChannel.GetString("title")) $("Link: " + $rssChannel.GetString("link")) $("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; $i -le $numItems - 1; $i++) { $rssItem = $rssChannel.GetItem($i) $("----") $("Title: " + $rssItem.GetString("title")) $("Link: " + $rssItem.GetString("link")) $("pubDate: " + $rssItem.GetString("pubDate")) $numCategories = $rssItem.GetCount("category") if ($numCategories -gt 0) { for ($j = 0; $j -le $numCategories - 1; $j++) { $(" category: " + $rssItem.MGetString("category",$j)) } } } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.