Obtener mis últimos tweets mediante PHP
Hola vamos a ver como obtener mis últimos tweets mediante PHP. La siguiente función permite mostrar los últimos tweets de un usuario. Tan sólo debemos pasarle como parámetro el nombre de usuario de la cuenta y el número de tweets a mostrar.
Función
Función
function my_twitter($usuario,$tweets) { $feed = "http://search.twitter.com/search.atom?q=from:" . $usuario . "&rpp=" . $tweets; $xml = simplexml_load_file($feed); foreach($xml->children() as $child) { foreach ($child as $value) { if($value->getName() == "content") { $content = $value . ""; echo '<p class="twit">'.$content.'</p>'; } } } }Ultimos 5 tweets
my_twitter("nombre_usuario",5);
0
Puntos
Puntos
1340
Visitas
Visitas
0
Resp
Resp
Por demonio23 hace 110 meses
Moderador