...

View Full Version : Gather information from another website



IFeelYourPain
04-24-2011, 07:39 AM
I want to extract information from playstation website to use on my forums for VBulletin.

For example
http://us.playstation.com/publictrophy/index.htm?onlinename=Roughdawg4

I want to extract the level (35) and number of trophies (7861) and use them on my forums, in my postbit. I make VBulletin modifications, and know some php, but dealing with another website confuses me, and I'd like to learn more.

If Playstation had an API, I would use it, but unfortunately they don't. This website can do it somehow, and I would like to learn how.
http://www.ps3trophies.com/leaderboard/

I tried something like this to no extent... =[

<?php
$source = file_get_contents("http://us.playstation.com/publictrophy/index.htm?onlinename=Roughdawg4");
if ($source = file_get_contents("http://us.playstation.com/publictrophy/index.htm?onlinename=Roughdawg4")) {
$search = "Level";
$newText = substr($source,strpos($source, $search)+strlen($search), 100);
echo $newText;
} else {
null
}
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum