hecky

Buscador de Twitter desde Consola [BASH]

Mar 5th, 2012
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. //CLI Twitter Search
  2. //@hecky hecky@neobits.org
  3. //http://Neobits.org
  4.  
  5. //Script Creado en Bash que  al ejecutarlo permite hacer uso del buscador de Twitter desde la comodidad de tu consola
  6. //Algunos acentos no se muestran correctamente por la decodificación del UNICODE
  7. //Puede hacer una búsqueda máxima de 1500 tweets por consulta. En promedio Cada 10 segundos
  8. //Para la ejecución se necesita:
  9. //.-curl
  10. //.-php
  11. //uni2ascii-ascii2uni
  12.  
  13. clear && echo -n "Ingresa Palabra a buscar en Twitter.com: " && read parametro && echo "" && for tweet in {1..15};do curl search.twitter.com/search.json?q=$parametro\&rpp=100\&lang=es\&page=$tweet 2> /dev/null | grep text | php -r 'error_reporting(0); $c=""; $a=file_get_contents("php://STDIN"); for($i=100;$i>=1;$i--){$b=explode("text\":\"",$a); $c=explode("\",\"to_user",$b[$i]); echo html_entity_decode($c[0]).((strlen($c[0]) > 2) ? "\n" : "");}';done | nl | ascii2uni -q -a U | php -r 'echo stripslashes(file_get_contents("php://STDIN"));'
Advertisement
Add Comment
Please, Sign In to add comment