Muchos plugins nos permiten preparar una lista con nuestros últimos tweets, normalmente en la barra lateral. Si queremos implementar la misma funcionalidad sin un plugin (para que esté disponible directamente en nuestro tema en uso), podemos utilizar las funciones nativas de Twitter.
En sidebar.php por ejemplo vamos a buscar un espacio para disponer la lista de tweets:
<ul id="twitter_update_list"> </ul> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/username.json?callback=twitterCallback2&count=3" ?></script>
Recordemos que donde pone “username” deberemos escribir nuestro nombre de usuario de Twitter (y debe ser una cuenta “abierta”, sin candado).
Podemos modificar "count=3", al final de la última línea, por el número de tweets que deseamos mostrar.
La lista la dejaremos vacía, debería llenarse automáticamente con los correspondientes tweets.
Esperamos que este truco os sea útil.
Etiquetas: Twitter



3 comentarios
25/02/2011
Funciona de maravilla, gracias.
09/09/2011
Breakin News: Thanks for the post I actually learned something from it. Very good content on this site Always looking forward to new post.
25/10/2011
I as well as my friends were actually viewing the best pointers found on the blog and quickly got a terrible suspicion I never expressed respect to the web blog owner for those strategies. Most of the guys came for that reason warmed to read through all of them and have in effect seriously been using them. Many thanks for really being well accommodating and for deciding upon these kinds of beneficial areas millions of individuals are really eager to learn about. My personal sincere apologies for not expressing appreciation to sooner.
Trackbacks
Deja tu comentario