Delphi Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

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.

uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls,
    CHILKATXMLLib_TLB,
    OleCtrls;

...

procedure TForm1.Button1Click(Sender: TObject);
var
rss: TChilkatRss;
success: Integer;
rssChannel: IChilkatRss;
numItems: Integer;
i: Integer;
rssItem: IChilkatRss;
numCategories: Integer;
j: Integer;

begin
rss := TChilkatRss.Create(Self);

//  Download from the feed URL:
success := rss.DownloadRss('http://blog.chilkatsoft.com/?feed=rss2');
if (success <> 1) then
  begin
    ShowMessage(rss.LastErrorText);

  end;

//  Get the 1st channel.

rssChannel := rss.GetChannel(0);
if (rssChannel = nil ) then
  begin
    ShowMessage('No channel found in RSS feed.');

  end;

//  Display the various pieces of information about the channel:
Memo1.Lines.Add('Title: ' + rssChannel.GetString('title'));
Memo1.Lines.Add('Link: ' + rssChannel.GetString('link'));
Memo1.Lines.Add('Description: ' + rssChannel.GetString('description'));

//  For each item in the channel, display the title, link,
//  publish date, and categories assigned to the post.
numItems := rssChannel.NumItems;

for i := 0 to numItems - 1 do
  begin
    rssItem := rssChannel.GetItem(i);

    Memo1.Lines.Add('----');
    Memo1.Lines.Add('Title: ' + rssItem.GetString('title'));
    Memo1.Lines.Add('Link: ' + rssItem.GetString('link'));
    Memo1.Lines.Add('pubDate: ' + rssItem.GetString('pubDate'));

    numCategories := rssItem.GetCount('category');

    if (numCategories > 0) then
      begin
        for j := 0 to numCategories - 1 do
          begin
            Memo1.Lines.Add('    category: '
                 + rssItem.MGetString('category',j));
          end;

      end;

  end;


end;

 

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

Mail Component · .NET Email Component · XML Parser