Page 1 of 1
[HELP]php grabber
Posted: Sun Dec 11, 2005 10:41 am
by bla5e
How do i get PHP to grab infomation/text from another website??
(I want PHP to grab my teams score from caleague.com and post it on my teams website)
Posted: Sun Dec 11, 2005 10:50 am
by Chris Corbyn
Combination of file_get_contents() and preg_match()
Posted: Sun Dec 11, 2005 10:50 am
by shiznatix
many different ways. probably the easiest would be do just do
Code: Select all
$data = file_get_contents('http://www.website_to_get.com');
then you are going to have to use some regex to get that desired information out of $data. that is definatly going to be the hardest part. post what you are looking to get out of it (like maybe the html where the information is) then someone can help you write that regex.
edit: sigh, i am getting too slow.
Posted: Mon Dec 12, 2005 1:57 pm
by bla5e
shiznatix wrote:many different ways. probably the easiest would be do just do
Code: Select all
$data = file_get_contents('http://www.website_to_get.com');
post what you are looking to get out of it (like maybe the html where the information is) then someone can help you write that regex.
edit: sigh, i am getting too slow.
http://caleague.com/?page=teams&teamid=42842 = the website to get
Record <CHANGES> = data i want to get
Posted: Mon Dec 12, 2005 2:03 pm
by shiznatix
then what you should do is ask someone to help you write a regex to do somtin like
Record <b>***this is what you want***</b><br/>
i would highly sugest posting in the regex forum when you post this, unless someone can quickly help the kid out? I don't know regex yet.
Posted: Mon Dec 12, 2005 2:03 pm
by Deemo
when you use file_get_contents you get the entire code of the parsed PHP. Then you have to manually search through the contents of the file and then find where it says Record and then extract the data
damn beat me
