I was like just messing around with PHP and explode etc and decided to make this script.
It just gets the current picture for the given MySpace account.PHP Code:<?php
function MySpacePicture($name){
$data = file_get_contents("http://myspace.com/".$name);
$linkstart = explode('<a id="ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage"', $data);
$linkend = explode('</a>', $linkstart[1]);
$link = trim($linkend[0]);
$imagestart = explode('<img src="', $link);
$imageend = explode('" border="0" />', $imagestart[1]);
$image = trim($imageend[0]);
return $image;
}
?>
Here is an example of using it with The Fratellis' MySpace. Lets say you saved the code in myspace.php
http://thomas.uk.to/myspace.phpPHP Code:<?php
include('myspace.php');
echo '<img src="' . MySpacePicture("littlebabyfratelli") . '">';
?>
I dont know why I created this, probably because I never know what to make.






Reply With Quote

