Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

 

Read RSS Feed

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

The Chilkat RSS class/component is freeware.

Download Chilkat C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C++ Libraries for VC++ 6.0 / Win32

#include <CkRss.h>

void ChilkatSample(void)
    {
    CkRss rss;

    bool success;

    //  Download from the feed URL:
    success = rss.DownloadRss("http://blog.chilkatsoft.com/?feed=rss2");
    if (success != true) {
        printf("%s\n",rss.lastErrorText());
        return;
    }

    //  Get the 1st channel.
    CkRss *rssChannel = 0;

    rssChannel = rss.GetChannel(0);
    if (rssChannel == 0 ) {
        printf("No channel found in RSS feed.\n");
        return;
    }

    //  Display the various pieces of information about the channel:
    printf("Title: %s\n",rssChannel->getString("title"));
    printf("Link: %s\n",rssChannel->getString("link"));
    printf("Description: %s\n",rssChannel->getString("description"));

    //  For each item in the channel, display the title, link,
    //  publish date, and categories assigned to the post.
    long numItems;
    numItems = rssChannel->get_NumItems();
    long i;

    for (i = 0; i <= numItems - 1; i++) {
        CkRss *rssItem = 0;
        rssItem = rssChannel->GetItem(i);

        printf("----\n");
        printf("Title: %s\n",rssItem->getString("title"));
        printf("Link: %s\n",rssItem->getString("link"));
        printf("pubDate: %s\n",rssItem->getString("pubDate"));

        long numCategories;
        numCategories = rssItem->GetCount("category");
        long j;
        if (numCategories > 0) {
            for (j = 0; j <= numCategories - 1; j++) {
                printf("    category: %s\n",rssItem->mGetString("category",j));
            }

        }

        delete rssItem;
    }

    delete rssChannel;
    }

Need a specific example? Send a request to support@chilkatsoft.com

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

Mail Component · .NET Mail Component · XML Parser