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
(Classic ASP) Read RSS FeedSample code showing how to read an RSS feed and emit the contents.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Rss") set rss = Server.CreateObject("Chilkat.Rss") ' Download from the feed URL: success = rss.DownloadRss("http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( rss.LastErrorText) & "</pre>" Response.End End If ' Get the 1st channel. ' rssChannel is a Chilkat.Rss Set rssChannel = rss.GetChannel(0) If (rss.LastMethodSuccess = 0) Then Response.Write "<pre>" & Server.HTMLEncode( "No channel found in RSS feed.") & "</pre>" Response.End End If ' Display the various pieces of information about the channel: Response.Write "<pre>" & Server.HTMLEncode( "Title: " & rssChannel.GetString("title")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Link: " & rssChannel.GetString("link")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Description: " & rssChannel.GetString("description")) & "</pre>" ' For each item in the channel, display the title, link, ' publish date, and categories assigned to the post. numItems = rssChannel.NumItems For i = 0 To numItems - 1 ' rssItem is a Chilkat.Rss Set rssItem = rssChannel.GetItem(i) Response.Write "<pre>" & Server.HTMLEncode( "----") & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Title: " & rssItem.GetString("title")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Link: " & rssItem.GetString("link")) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "pubDate: " & rssItem.GetString("pubDate")) & "</pre>" numCategories = rssItem.GetCount("category") If (numCategories > 0) Then For j = 0 To numCategories - 1 Response.Write "<pre>" & Server.HTMLEncode( " category: " & rssItem.MGetString("category",j)) & "</pre>" Next End If Next %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.