Jump to content

explode and myspace strings


tass2001

Recommended Posts

Okay so im writting a script to get myspace Variable information (i.e. about me, music, etc.) and output it as XML

Now i have the current script:

<?PHP		
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$LOGINURL = "http://www.myspace.com/imparanoid000";	

$ch = curl_init();     
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
url_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);	
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);		
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);	
$result = curl_exec($ch);
curl_close($ch);

echo '<span style="font-size: 12px; font-family: Verdana">';
$pieces = explode("About me:(/span><br/>", $result);
$aboutme = $pieces[1];	$pieces = explode("<span class=\"text\"><div style=\"display:none;\">", $aboutme);
$aboutme = $pieces[1];	$pieces = explode("</div>", $aboutme);	
$aboutme = $pieces[0];	
$aboutme = str_replace("\r\n", "<br>", $aboutme);	
echo "<b><u>Yo</u></b>".$aboutme."<br> 
?>

Idk why this code isn't working! it keeps outputing

Parse error: syntax error, unexpected $end in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\get.php on line 23

Why??

Also is there anyway for me to say do get.php?url=urlhere and have php insert it into the end of the LOGINID variable??

Link to comment
https://forums.phpfreaks.com/topic/80052-explode-and-myspace-strings/
Share on other sites

There were two typos

 

<?PHP
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$LOGINURL = "http://www.myspace.com/imparanoid000";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  # <-- missing
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
$result = curl_exec($ch);
curl_close($ch);

echo '<span style="font-size: 12px; font-family: Verdana">';
$pieces = explode("About me:(/span><br/>", $result);
$aboutme = $pieces[1];  $pieces = explode("<span class=\"text\"><div style=\"display:none;\">", $aboutme);
$aboutme = $pieces[1];  $pieces = explode("</div>", $aboutme);
$aboutme = $pieces[0];
$aboutme = str_replace("\r\n", "<br>", $aboutme);
echo "<b><u>Yo</u></b>".$aboutme."<br>" ; # <_ missing
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.