Parse error: syntax error, unexpected T_STRING in...
Posted
by rabidmachine9
on Stack Overflow
See other posts from Stack Overflow
or by rabidmachine9
Published on 2010-05-26T12:28:08Z
Indexed on
2010/05/26
12:31 UTC
Read the original article
Hit count: 247
I' making this class to catch twitter posts but I get the error :
Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/classTest/Twitter.php on line 29
I cant find what's wrong...any ideas?
class TwitterGrub{
function twitterCapture($user = 'myUsername',$password = 'myPass') {
$ch = curl_init("https://twitter.com/statuses/user_timeline.xml");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_TIMEOUT, 30);
curl_setopt($ch,CURLOPT_USERPWD,$user . ":" . $password);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
$result=curl_exec ($ch);
$data = strstr($result, '<?');
$xml = new SimpleXMLElement($data);
return $xml;
}
function twitterDisplay($twitNum){
$xml = this->twitterCapture();
for($i= 0; $i<$twitNum; $i++){
echo "<div class='curvebox'>".$xml->status[$i]->text."</div>";
}
}
}
© Stack Overflow or respective owner