Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

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


VB Strings
VB Byte Array

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 XML ActiveX

Note: The Chilkat XML ActiveX also includes the Chilkat RSS and Atom components.

Dim rss As New ChilkatRss

Dim success As Long

'  Download from the feed URL:
success = rss.DownloadRss("http://blog.chilkatsoft.com/?feed=rss2")
If (success <> 1) Then
    MsgBox rss.LastErrorText
    Exit Sub
End If

'  Get the 1st channel.
Dim rssChannel As ChilkatRss

Set rssChannel = rss.GetChannel(0)
If (rssChannel Is Nothing ) Then
    MsgBox "No channel found in RSS feed."
    Exit Sub
End If

'  Display the various pieces of information about the channel:
Text1.Text = Text1.Text & "Title: " & rssChannel.GetString("title") & vbCrLf
Text1.Text = Text1.Text & "Link: " & rssChannel.GetString("link") & vbCrLf
Text1.Text = Text1.Text & "Description: " & rssChannel.GetString("description") & vbCrLf

'  For each item in the channel, display the title, link,
'  publish date, and categories assigned to the post.
Dim numItems As Long
numItems = rssChannel.NumItems
Dim i As Long

For i = 0 To numItems - 1
    Dim rssItem As ChilkatRss
    Set rssItem = rssChannel.GetItem(i)

    Text1.Text = Text1.Text & "----" & vbCrLf
    Text1.Text = Text1.Text & "Title: " & rssItem.GetString("title") & vbCrLf
    Text1.Text = Text1.Text & "Link: " & rssItem.GetString("link") & vbCrLf
    Text1.Text = Text1.Text & "pubDate: " & rssItem.GetString("pubDate") & vbCrLf

    Dim numCategories As Long
    numCategories = rssItem.GetCount("category")
    Dim j As Long
    If (numCategories > 0) Then
        For j = 0 To numCategories - 1
            Text1.Text = Text1.Text & "    category: " _
                 & rssItem.MGetString("category",j) & vbCrLf
        Next

    End If

Next


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

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