intento recuperar los últimos tweets de un usuario con este codigo en PHP:
Código:
pero al ejecutarlo obtengo varios warnings:$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.twitter.com/1.1/statuses/user_timeline.json?user_id=10793472"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $xml = simplexml_load_string($output); foreach ($xml as $status) { echo $status->text; echo "<br />"; }
Código HTML:
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in C:\xampp\htdocs\OOP\rest.php on line 14 Warning: simplexml_load_string(): {"errors":[{"code":215,"message":"Bad Authentication data."}]} in C:\xampp\htdocs\OOP\rest.php on line 14 Warning: simplexml_load_string(): ^ in C:\xampp\htdocs\OOP\rest.php on line 14 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\OOP\rest.php on line 15
Gracias, saludos:D