Guest User

Trending Topic Change Detector | JaAViEr | www.codigo.ga

a guest
Nov 23rd, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Autor: JaAViEr|0x5d
  3. Twitter: @javieresteban__
  4. Website: http://codigo.ga
  5. Descripcion: Envia un Tweet cuando se detecta un cambio en la tendencia n°1.
  6. Description: It sends a Tweet When It detects a change on first trending topic.
  7. */
  8. var get_tt = function(counter){
  9.   var tt = "";
  10.   counter = counter - 1;
  11.   $("a.trend-name").each(function(i){
  12.     if(i <= counter){
  13.       tt = tt + " " + $(this).text();
  14.     }
  15.   });
  16.   return tt;
  17. }
  18. var actual = "";
  19. actual = get_tt(1);
  20. tt_verify = window.setInterval(function(){
  21.     if(actual != get_tt(1)){
  22.        
  23.       $("#tweet-box-mini-home-profile div").text("Nuevo Trending Topic:" + get_tt(1) + "By www.codigo.ga");
  24.       $(".js-tweet-btn").click();
  25.       $("#tweet-box-mini-home-profile div").text("");
  26.       actual = get_tt(1);
  27.    
  28.     }
  29.  
  30.   }, 1500);
Add Comment
Please, Sign In to add comment