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

DataFlex 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
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

 

 

 

(DataFlex) Read RSS Feed

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

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoRss
    Boolean iSuccess
    Variant vRssChannel
    Handle hoRssChannel
    Integer iNumItems
    Integer i
    Variant vRssItem
    Handle hoRssItem
    Integer iNumCategories
    Integer j
    String sTemp1
    Boolean bTemp1

    Get Create (RefClass(cComChilkatRss)) To hoRss
    If (Not(IsComObjectCreated(hoRss))) Begin
        Send CreateComObject of hoRss
    End

    // Download from the feed URL:
    Get ComDownloadRss Of hoRss "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" To iSuccess
    If (iSuccess <> True) Begin
        Get ComLastErrorText Of hoRss To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    // Get the 1st channel.
    Get ComGetChannel Of hoRss 0 To vRssChannel
    If (IsComObject(vRssChannel)) Begin
        Get Create (RefClass(cComChilkatRss)) To hoRssChannel
        Set pvComObject Of hoRssChannel To vRssChannel
    End
    Get ComLastMethodSuccess Of hoRss To bTemp1
    If (bTemp1 = False) Begin
        Showln "No channel found in RSS feed."
        Procedure_Return
    End

    // Display the various pieces of information about the channel:
    Get ComGetString Of hoRssChannel "title" To sTemp1
    Showln "Title: " sTemp1
    Get ComGetString Of hoRssChannel "link" To sTemp1
    Showln "Link: " sTemp1
    Get ComGetString Of hoRssChannel "description" To sTemp1
    Showln "Description: " sTemp1

    // For each item in the channel, display the title, link,
    // publish date, and categories assigned to the post.
    Get ComNumItems Of hoRssChannel To iNumItems

    For i From 0 To (iNumItems - 1)
        Get ComGetItem Of hoRssChannel i To vRssItem
        If (IsComObject(vRssItem)) Begin
            Get Create (RefClass(cComChilkatRss)) To hoRssItem
            Set pvComObject Of hoRssItem To vRssItem
        End

        Showln "----"
        Get ComGetString Of hoRssItem "title" To sTemp1
        Showln "Title: " sTemp1
        Get ComGetString Of hoRssItem "link" To sTemp1
        Showln "Link: " sTemp1
        Get ComGetString Of hoRssItem "pubDate" To sTemp1
        Showln "pubDate: " sTemp1

        Get ComGetCount Of hoRssItem "category" To iNumCategories

        If (iNumCategories > 0) Begin
            For j From 0 To (iNumCategories - 1)
                Get ComMGetString Of hoRssItem "category" j To sTemp1
                Showln "    category: " sTemp1
            Loop

        End

        Send Destroy of hoRssItem
    Loop

    Send Destroy of hoRssChannel


End_Procedure

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.