Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

DataFlex Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
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
NTLM
OAuth1
OAuth2
Office365
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

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