4 de septiembre de 2010 | 5:16 pm
0
Mostrar Tweets con PHP
Etiquetas: Noticias, php, Recursos, Scripts, tweets, twitter
Mostrar últimos Tweets con PHP
Con este simple script PHP podemos mostrar los últimos tweets de un usuario.[ad#Google Adsense-1]
Sólo debemos pasarle como parámetro el nombre de usuario de la cuenta y el número de tweets a mostrar.
<pre title="Código a utilizar">function my_twitter($usuario,$<strong>tweets</strong>) { $feed = "http://search.twitter.com/search.atom?q=from:" . $usuario . "&rpp=" . $<strong>tweets</strong>; $xml = simplexml_load_file($feed); foreach($xml->children() as $child) { foreach ($child as $value) { if($value->getName() == "content") { $content = $value . ""; echo '<p>'.$content.'</p>'; } } } }</pre>
Luego para mostrar los tweets solo basta con:
my_twitter("sessionstudio",5);
Visto en webintenta

[...] This post was mentioned on Twitter by Diseño Web y Gráfico, Diseño Web y Gráfico. Diseño Web y Gráfico said: Nuevo Post: Mostrar Tweets con PHP http://bit.ly/aMH8Gc [...]
[...] Como mostrar tus tweets con PHP http://www.sessionstudio.com.ar/blog/2010/09/04/mostrar-tweets-c… ...
[...] » noticia original Esta entrada fue publicada en Code/Código, Programming. Guarda el enlace permanente. ← Un script PHP de envío de formularios que funciona | Bájate el script corregido Prevenir el re-envío de formularios en PHP → [...]