Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 2 - Creating an RSS Reader
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Creating an RSS Reader
By: Jacques Noah
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-08-16

    Table of Contents:
  • Creating an RSS Reader
  • Code
  • Web Browser Code
  • Navigation Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating an RSS Reader - Code


    (Page 2 of 4 )

    Start a new application and add the following:

    Component

    Tab

    Rename

    Align

    Toolbar       

    Win32

    Toolbar1

    alTop

    TTreeview

    Win32

    Tv1

    alLeft

    TSplitter

    Additional

    Splitter1

    alLeft

    TWebbrowser

    Internet

    wb

    alClient

    StatusBar

    Win32

    Statusbar1

    alBottom

    TSpeedButton

    Additional

    SpeedButton1

    auto

    TSpeedButton

    Additional

    SpeedButton2

    auto

    TSpeedButton

    Additional

    navBack

    auto

    TSpeedButton

    Additional

    navForward

    auto

    TSpeedButton

    Additional

    wbHome

    auto

    TSpeedButton

    Additional

    wbStop

    auto

    TSpeedButton

    Additional

    wbRefresh

    auto

    You should have something like this:

    Once all of the above is set, double click on the OnCreate event and add the following code:

    procedure TForm1.FormCreate(Sender: TObject);
    var
    rec:TSearchRec;
    SomeTxtFile : TextFile;
    buffer : string;

    begin
    //read links from links file   ***********************************
    with tv1.Items.AddFirst(  nil,  'RSS Links'  ) do
    begin
    Selected := true;
    end;
    if fileexists('links.txt')  then begin
    AssignFile(SomeTxtFile, 'links.txt');
    Reset(SomeTxtFile);
    while not EOF(SomeTxtFile) do begin
    ReadLn(SomeTxtFile, buffer);
    with tv1.Items.AddChildFirst(  tv1.Selected,  buffer) do
    begin
    MakeVisible;
    end;
    end;
    CloseFile(SomeTxtFile);
    end //fileexists
    else begin
    with tv1.Items.AddFirst(  nil,  'No RSS Links Found'  ) do
    begin
    Selected := true;
    end;
    end ;
    end;

    The above code basically loads the RSS links from a textfile that is located on the local disk and adds them to the treeview. You can only view these links once you are connected to the Internet. Next, double click on the OnDblClick event of the treeview component and add the following code:

    procedure TForm1.tv1DblClick(Sender: TObject);
    begin
    if (tv1.Selected.Level <> 0) then begin
    fn:=tv1.Selected.Text;
    form1.Caption:='';
    //update the form caption
    form1.Caption:='RSS XML File Reader - '+fn;
    wb.Navigate(fn);
    end;
    end;

    All that happens in the above code is that it basically navigates the selected RSS link to the WebBrowser component. The link name is captured in the "fn" variable and then the form caption is updated with it. Then the program gets the RSS data from the Internet link (stored in the fn variable) and displays the contents in the WebBrowser component

    More Delphi-Kylix Articles
    More By Jacques Noah


     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT