Nucleo Robot TprenD 1.6

TprenD likea todo canal Global - Autofollow y crapero también (v6)

当前为 2019-02-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Nucleo Robot TprenD 1.6
  3. // @namespace https://greasyfork.org/es/scripts?set=334066
  4. // @version 1.10
  5. // @description TprenD likea todo canal Global - Autofollow y crapero también (v6)
  6. // @author by @kchamat
  7. // @match https://classic.taringa.net/TprendMod*
  8. // @include https://classic.taringa.net/*
  9. // @exclude https://classic.taringa.net/*/siguiendo/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. // ---- Para utilizarlo con otra cuenta debe cambiar la palabra TPRENDMOD por su Nick de Usuario y el numero de user_id por el id de su cuenta
  14. // ---- si desconoce el id de su cuenta ingrese en https://api.taringa.net/user/nick/view/SU_PROPIO_NICK
  15.  
  16. (function() {
  17. 'use strict';
  18. var user_nick="TprendMod";
  19. var user_id="29024560";
  20. var segundos=3;
  21.  
  22. function getParameterByName(name) {
  23. name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  24. var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
  25. results = regex.exec(location.search);
  26. return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
  27. }
  28. // funcion redirigir a tal url en 10 segundos
  29. function redirigir_a_en(url,seg) {
  30. var a = document.createElement("a");
  31. a.href = url;
  32. setTimeout(function() {
  33. a.click();
  34. }, seg*1000);
  35. }
  36. ///función para abrir en una 2da pestaña e ir dando unfollow
  37. function abrirEnPestana(url) {
  38. var a = document.createElement("a");
  39. a.target = "_al_lado";
  40. a.href = url;
  41. a.click();
  42. }
  43. // funcion para cambiar la url, por la siguiente,
  44. function change_my_url(sig_url){
  45. var stateObj = { foo: "bar" };
  46. history.pushState(stateObj, "page 2", sig_url);
  47. }
  48. var nro_page = parseInt(getParameterByName('pagina'))+1;
  49. if (isNaN(nro_page)){
  50. nro_page=0;
  51. }
  52. if (nro_page>80){
  53. nro_page=0;
  54. }
  55.  
  56.  
  57. ;
  58. //Likeando todo todo
  59. $.getJSON("https://api.taringa.net/shout/public/view", function(data) {
  60. $.each(data, function(i, item) {
  61. var id = item.id;
  62. var owner = item.owner.id;
  63. $.ajax({
  64. url: '/ajax/shout/vote',
  65. type: 'post',
  66. dataType: 'json',
  67. data: {
  68. owner: owner,
  69. uuid: id,
  70. score: 1
  71. },
  72. });
  73. });
  74.  
  75. });
  76. window.stop();
  77. // métodos de comportamiento cíclico
  78. var url='https://classic.taringa.net/'+user_nick+'?pagina='+nro_page;
  79. var siguiente_url='/'+user_nick+'?pagina='+nro_page;
  80. $('head').append('<meta http-equiv="refresh" content="'+segundos+'">' );
  81. redirigir_a_en(url,segundos);
  82. change_my_url(siguiente_url)
  83. var nedge='https://classic.taringa.net/'+user_nick+'/siguiendo/'+(nro_page-1);
  84. abrirEnPestana(nedge);
  85.  
  86. //Seguir usuarios desde nro_page
  87. var urlapi="https://api.taringa.net/user/followers/view/"+user_id+"?trim_user=true&count=30&page="+nro_page;
  88. //alert(urlapi);
  89. $.getJSON("https://api.taringa.net/user/followers/view/"+user_id+"?trim_user=true&count=30&page="+nro_page, function(data) {
  90. $.each(data, function(nro_item2,user2) {
  91. var id = user2;
  92. notifica.ajax(Array("action=follow","type=user","obj=" + id),null,null,true,false);
  93. });
  94. });
  95. //Juega a los dados, si sale 1 crapea un shout si sale 2 lo reshoutea
  96. $.getJSON( "https://api.taringa.net/shout/random/view", function( data ) {
  97. var items = [];
  98. $.each( data, function( key, val ) {
  99. items.push( key + ":" + val + "<br>" );
  100. });
  101. var chance=Math.floor((Math.random() * 15) + 1);
  102. var tipo_shout=data.attachment.type;
  103. var owner_nick=data.owner.nick;
  104. var owner_id=data.owner.id;
  105. var id_shout=data.id;
  106. var texto=data.body;
  107. console.log(chance);
  108. console.log(tipo_shout);
  109. var seleccionador=chance+tipo_shout;
  110. var image_url=data.attachment.url;
  111. var contenido=" ";
  112. //Crapeo al azar
  113. if (seleccionador=='1image'){
  114. image_url=data.attachment.url
  115. contenido=texto+"\n <════Se lo re crapi&eacute; a @"+owner_nick+"════>";
  116. $.ajax({
  117. type : 'POST',
  118. dataType: 'json',
  119. url : '/ajax/shout/add',
  120. data : {
  121. key : global_data.user_key,
  122. body : contenido,
  123. privacy : 0,
  124. attachment_type : 1,
  125. attachment : image_url
  126. }
  127. });
  128. //new Audio('https://www.soundjay.com/button/sounds/button-44.mp3').play();
  129. }
  130. //Reshout al azar
  131. if (seleccionador=='2image'){
  132. image_url=data.attachment.url
  133. contenido=texto+"\n <════Se lo re crapi&eacute; a @"+owner_nick+"════>";
  134. $.ajax({
  135. url: '/ajax/shout/add',
  136. type: 'post',
  137. dataType: 'json',
  138. data: {
  139. key: global_data.user_key,
  140. parent_id: id_shout,
  141. parent_owner: owner_id
  142. },
  143. success: function(res) {
  144. callback(res);
  145. },
  146. error: function(xhr, status, error){
  147. callback(xhr);
  148. }
  149. });
  150. //new Audio('https://www.soundjay.com/button/sounds/button-44.mp3').play();
  151. }
  152. });
  153. })();