Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - Finishing 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

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

    Table of Contents:
  • Finishing an RSS Reader
  • New code
  • Getting files from a website
  • Full code for the RSS reader

  • 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


    Finishing an RSS Reader - Getting files from a website


    (Page 3 of 4 )

    So our application will now let us view RSS links in a web browser. It will also let us view locally stored XML files in a list view. But we have not yet discussed how to get the RSS or XML file from a website. So let's get on with it.

    In Delphi, open up form3 and add an idHTTP component from the Indy clients tab. Then rename the TEdit to "url." And put http:// in its Text property on the object inspector. Form3 should look something like this:

    Double click on the button and add the following code:

    procedure TForm3.btnURLClick(Sender: TObject);
    var
    FStream: TFileStream;
    begin
    FStream := TFileStream.Create('feed.xml', fmCreate);
    try
    IdHTTP1.Get(url.Text, FStream);
    finally
    FStream.Free;
    form1.wb.Navigate(url.Text);
    end;
    close;
    end;

    Before downloading the file, we create a TStream object to store its content, as the code below demonstrates:

    FStream := TFileStream.Create('feed.xml', fmCreate);

    The filename does not have to be "feed.xml;" it can be anything you want. The next bit of code actually gets the file from the website:

    IdHTTP1.Get(url.Text, FStream);

    The content of the file on the Internet is written to the "feed.xml" file and stored on the local disk.

    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 3 hosted by Hostway
    Stay green...Green IT