943,789 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1035
  • PHP RSS
Feb 7th, 2008
0

retrieving live information from other sites

Expand Post »
is it possible to retrieve live data (maybe an xml file) from a website to use on your own website?

,lacking in knowledge of new technology
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xeeb is offline Offline
4 posts
since Feb 2008
Feb 7th, 2008
0

Re: retrieving live information from other sites

absolutely! There is a lot of material out there on the subject, so expect to spend some time learning some new tricks.

there are several ways to go about doing it. For a simple introduction to PHP and XML check out http://www.kirupa.com/developer/php/php5_simpleXML.htm

In that example, just replace the path of file_get_contents with the path to the remote XML file you want to use.

for example:
php Syntax (Toggle Plain Text)
  1. <?php
  2. //Since we're already using PHP5, why don't we exploit their easy to use file_get_contents() command?
  3. $xmlFileData = file_get_contents("http://www.howtocreate.co.uk/operaStuff/userjs/samplexml.xml");
  4. //Here's our Simple XML parser!
  5. $xmlData = new SimpleXMLElement($xmlFileData);
  6. //And here's the output.
  7. print_r($xmlData);
  8.  
  9. ?>

Of course you can parse XML entirely without PHP if you are interested in learning / already know XSL (more on this at w3.org: http://www.w3.org/Style/XSL/)

if you just want to include content from other sites (i.e. an entire webpage) you can just do something like:

php Syntax (Toggle Plain Text)
  1. <?php
  2. //get google.com
  3. $fileData = file_get_contents("http://google.com");
  4.  
  5. //do something with fileData here
  6.  
  7. echo $fileData;
  8.  
  9. ?>

then you can try and hack up the code however you want...
Reputation Points: 14
Solved Threads: 14
Junior Poster in Training
johnsquibb is offline Offline
84 posts
since Nov 2007
Feb 8th, 2008
0

Re: retrieving live information from other sites

thanks for the quick reply.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xeeb is offline Offline
4 posts
since Feb 2008
Feb 8th, 2008
0

Re: retrieving live information from other sites

i'm trying to retrieve some "live" movie times to add on my website, but it's all in flash.
is there a way to get around that? do you know how movie searches are accomplished?
do they contact the actual headquarters for access to parts of the database or do they
obtain info by parsing their site?

,learning slowly
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xeeb is offline Offline
4 posts
since Feb 2008
Feb 8th, 2008
0

Re: retrieving live information from other sites

I'm not sure which site you mean is in flash...your site or the site you are trying to get the show times from? If you are trying to integrate dynamic content into your flash, then you might want to check out articles regarding XML in Flash, such as this one. There are a lot more out there, so poke around.

I'm not certain how movie times are aggregated, but if you google a bit with the terms 'movie times rss' or 'movie times xml' etc., you should be able to uncover some details.
Reputation Points: 14
Solved Threads: 14
Junior Poster in Training
johnsquibb is offline Offline
84 posts
since Nov 2007
Feb 9th, 2008
0

Re: retrieving live information from other sites

this is the website that i'm trying to obtain movie information from:
www.cgv.co.kr

the website is all in flash

is it possible to obtain information from websites like this one if they do not provide
RSS Feed?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xeeb is offline Offline
4 posts
since Feb 2008
Feb 9th, 2008
0

Re: retrieving live information from other sites

Click to Expand / Collapse  Quote originally posted by xeeb ...
is it possible to obtain information from websites like this one if they do not provide RSS Feed?
I don't think so. Flash does a good job of wrapping up all the information so that you can't easily manipulate or edit it.

Is there another site for Korean showtimes (like Fandango in the US)? Unless they're printed in HTML or XML, you're not going to be able to extract them from a site and re-use them.

As for sites that get the info directly from the movie theaters, they most likely have access to a central database. Sites with lots of info (like Amazon.com) give out read-access to parts of their database, so that developers can integrate the information into their site.

I'd assume there's some kind of high-level database for cinemas, and that's where sites like Fandango, Enjoytheshow, etc. get the movie times.

- Walkere
Reputation Points: 29
Solved Threads: 5
Junior Poster in Training
Walkere is offline Offline
57 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: using Onchange() in PHP
Next Thread in PHP Forum Timeline: increment date by week





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC