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
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
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.