|  | 
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
| (Tcl) 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. 
 load ./chilkat.dll set rss [new_CkRss] # Download from the feed URL: set success [CkRss_DownloadRss $rss "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"] if {$success != 1} then { puts [CkRss_lastErrorText $rss] delete_CkRss $rss exit } # Get the 1st channel. # rssChannel is a CkRss set rssChannel [CkRss_GetChannel $rss 0] if {[CkRss_get_LastMethodSuccess $rss] == 0} then { puts "No channel found in RSS feed." delete_CkRss $rss exit } # Display the various pieces of information about the channel: puts "Title: [CkRss_getString $rssChannel title]" puts "Link: [CkRss_getString $rssChannel link]" puts "Description: [CkRss_getString $rssChannel description]" # For each item in the channel, display the title, link, # publish date, and categories assigned to the post. set numItems [CkRss_get_NumItems $rssChannel] for {set i 0} {$i <= [expr $numItems - 1]} {incr i} { # rssItem is a CkRss set rssItem [CkRss_GetItem $rssChannel $i] puts "----" puts "Title: [CkRss_getString $rssItem title]" puts "Link: [CkRss_getString $rssItem link]" puts "pubDate: [CkRss_getString $rssItem pubDate]" set numCategories [CkRss_GetCount $rssItem "category"] if {$numCategories > 0} then { for {set j 0} {$j <= [expr $numCategories - 1]} {incr j} { puts " category: [CkRss_mGetString $rssItem category $j]" } } delete_CkRss $rssItem } delete_CkRss $rssChannel delete_CkRss $rss | ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.