Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Tcl Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Tcl) Read RSS Feed

Sample code showing how to read an RSS feed and emit the contents.

Chilkat Tcl Extension Downloads

Chilkat Tcl Extension Downloads

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-2024 Chilkat Software, Inc. All Rights Reserved.