RSS2HTML Scout

Hello, World! example for RSS2HTML Scout library and Borland Delphi

Products Download Purchase Support Contacts
 
RSS2HTML Scout
Direct Links

 

 

Looking for ASP script to display RSS? Check our RSS2HTMLPro.ASP script for ASP/ASP.NET

 

How to create HTML page displaying news from RSS channel using RSS2HTML Scout library with Borland Delphi: "Hello, World!" example

 

You can download the source code of this example here: rss2htmlscout_delphi.zip

This page provides a simple example for RSS2HTML Scout with Borland Delphi to show how you can start with RSS2HTML Scout library and Borland Delphi.

RSS2HTML Scout is capable of downloading RSS feeds using built-in multi-threaded and converting RSS into HTML code using HTML templates (check the online documentation for more information about templates)

Download and install the latest version of RSS2HTML Scout. You can download it here

To use RSS2HTML Scout ActiveX in Borland Delphi we need to import type library and install RSS2HTML Scout on components palette.

Run Borland Delphi and go to Project menu. Then click Import Type Library... menu item to show Import Type Library dialog:

Import Type Library dialog will appear. Find RSS2HTML Scout library in the list of type libraries and click Install button as shown below:

Now select a package where you want to install RSS2HTML Scout component and click OK

Borland Delphi will ask you to confirm rebuilding of the selected package. Click Yes to rebuild the package:

Delphi will rebuild the package. Click OK


Now we will use this new RSS2HTML Scout component in a new Delphi application project.

Go to File menu and select the New - Application command to create a new empty project as shown below:

Borland Delphi will create a new empty project with an empty form

To add RSS2HTML Scout component to the Form1 go to View meny and click Component List item:

Now enter TRSS2HTMLScout in the component find box and it will select TRSS2HTMLScout component. Click Add To Form button to add the component to Form1:

Now double-click on an empty surface of the form and Delphi will create Form1Create procedure where we will place the code for RSS to HTML conversion using TRSS2HTMLScout1 object

 

This code will use TRSS2HTMLScout to download RSS feed and save it into TestOutput.html html file. Content of Unit1.pas is below:

unit Unit1;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleServer, RSS2HTMLScoutLib_TLB, ShellApi;

type
TForm1 = class(TForm)
RSS2HTMLScout1: TRSS2HTMLScout;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

var
s: string;
begin
  RSS2HTMLScout1.AddFeed('http://feeds.feedburner.com/gizmodo/full',30); // update every 30 minutes
  if NOT RSS2HTMLScout1.Execute
    then MessageDlg(Format('Error: %s',[RSS2HTMLScout1.ErrorMessage]), mtError, [mbOK], 0);
  s:= ExtractFilePath(Application.ExeName)+'testOutput.html';
  RSS2HTMLScout1.SaveOutputToFile(s);
  ShellExecute(GetDesktopWindow, 'open', PChar(s), nil, nil, SW_SHOWNORMAL);

end;

end.

Press F9 to compile and run the project. The Project1 will be compiled and executed and here is a screenshot of TestOutput.html:

HTML content converted from RSS using RSS2HTML Scout ActiveX library

You can also view generated HTML file in Borland Delphi application using TWebBrowser control
 
You can download the source code of this example here: rss2htmlscout_delphi.zip




"Hello, World!" examples for different programming languages will guide you step by step from the very beginning:

See also:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  
ByteScout, 2003-2005. All other company and product names may be trademarks of their respective companies.Flash and Macromedia Flash are trademarks of Macromedia, Inc. Privacy Statement