Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
Grab information from another Website

Posted by keith (keith), 1 March 2005
Hi all,

In our training course, you showed us how to use ('rip') information from another website.

I wan't to get the latest exchange rates and use them to maintain pricing details.



Posted by admin (Graham Ellis), 2 March 2005
Here's the vital line from our exchange rate convertor - this example script visits the web site of the Central European Bank and reads the file of exchange rates that's available there as an XML feed. Very similar to what you want!

$stuff = file("");

Note of caution for the reader of this page who is looking to "rip off" (as Keith put it) other sites.  Please check that your action is acceptable before you grab content in this way.  Respect the site owner's copyright and robots exclusion requests (as you will be a robot).  Look to store a cached copy of the information you grab and refresh it only from time to time. Just because something is easily possible doesn't mean it's legal.  Look at copying CDs!.  Keith - what you're looking to do is fine, though I would suggest you keep a local copy of the file and only refresh it once a day.  You can have your script check do this automatically.

Posted by admin (Graham Ellis), 2 March 2005
I've written a full demo application - this is something that crops up quite often.

Run the demo

Read about it and see the code

Posted by keith (keith), 4 March 2005
Thanks Graham.
I am only using this script to grab 'useful' and 'legal' content for my site. I will not use it to illegally grab other peoples hard work! (eg; images)

Also thanks for the tip about updating once a day.



Posted by admin (Graham Ellis), 6 March 2005
on 03/04/05 at 22:08:35, keith wrote:
Thanks Graham.
I am only using this script to grab 'useful' and 'legal' content for my site.

I totally know this, Keith ... we pick up exchange rates in just exactly this way from the public European Bank site, where they provide a file for this very purpose.

Solutions posted on "Opentalk" are visible to the originator of the question, and to anyone else who happens to come by. Nearly 500 people are registered here now, and many more will find and read the archives occasionally through a search engine such as Google.

So where I talk about a technique through which people could, even unknowingly, make a nuisance of themselves or break one of various laws, I have to add appropriate cautions onto the end of my post.  

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: • WEB: • SKYPE: wellho