cazaTools

Herramientas para automatizar acciones en Taringa.net.

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

  1. // ==UserScript==
  2. // @name cazaTools
  3. // @namespace CazaTools
  4. // @version 0.2
  5. // @description Herramientas para automatizar acciones en Taringa.net.
  6. // @author @Cazador4ever - @EdvardGrieg
  7. // @match http*://www.taringa.net/mi
  8. // @include http*://www.taringa.net/posts/*
  9. // @include http*://www.taringa.net/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function($) {
  14. 'use strict';
  15. function cazaTools() {
  16. function getRnd(arr) {
  17. return arr[Math.floor(Math.random() * arr.length)];
  18. }
  19. var exists = !!$('#cazaTools').length;
  20. if ( !exists ) {
  21. $('body').append('<style type="text/css">.cTools {-webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; float: right; width: 100px; position: fixed; top: 44%; left: 2px; padding: 10px 0; overflow: auto; border: none; -webkit-border-radius: 10px; border-radius: 10px; font: normal 16px/1 "Lucida Console", Monaco, monospace; color: rgb(255, 255, 255); text-align: center; -o-text-overflow: ellipsis; text-overflow: ellipsis; background: rgba(40,40,40,0.11); -webkit-transition: all 100ms cubic-bezier(0.25, 0.25, 0.75, 0.75); -moz-transition: all 100ms cubic-bezier(0.25, 0.25, 0.75, 0.75); -o-transition: all 100ms cubic-bezier(0.25, 0.25, 0.75, 0.75); transition: all 100ms cubic-bezier(0.25, 0.25, 0.75, 0.75); } .cTools:hover {font: normal normal bold 16px/1 "Lucida Console", Monaco, monospace; background: rgba(0,0,0,0.25); }</style>' +
  22. '<style type="text/css">.cBtn {display: inline-block; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; width: 30px; height: 30px; cursor: pointer; margin: auto; padding: 0 auto auto; border: 1px solid rgba(255,255,255,0.3); -webkit-border-radius: 5px; border-radius: 5px; font: normal 12px/normal "Lucida Console", Monaco, monospace; color: rgba(255,255,255,0.9); -o-text-overflow: clip; text-overflow: clip; background: #000000; -webkit-box-shadow: 2px 2px 5px 0 rgba(255,255,255,0.3) ; box-shadow: 2px 2px 5px 0 rgba(255,255,255,0.3) ; -webkit-transition: all 10ms cubic-bezier(0.42, 0, 0.58, 1); -moz-transition: all 10ms cubic-bezier(0.42, 0, 0.58, 1); -o-transition: all 10ms cubic-bezier(0.42, 0, 0.58, 1); transition: all 10ms cubic-bezier(0.42, 0, 0.58, 1); } .cBtn:hover {border: 1px solid rgba(255,255,255,0.5); } .cBtn:active {border: 1px solid rgba(255,255,255,0.58); -webkit-box-shadow: 2px 2px 5px 0 rgba(255,255,255,0.3) inset; box-shadow: 2px 2px 5px 0 rgba(255,255,255,0.3) inset; }</style>' +
  23. '<div id="cazaTools" class="cTools" style="position: fixed;">' +
  24. '<button id="reload" title="Recargar la pagina" class="cBtn"><img src="https://k60.kn3.net/8/2/2/B/7/7/B79.png" height="24" width="24"></button>' +
  25. '<button id="likeador" title="Dar like a shouts" class="cBtn"><img src="https://k60.kn3.net/A/3/2/D/D/C/99C.png" height="24" width="24"></button>' +
  26. '<button id="recomendar" title="Recomendar un post (funciona solo cuando estemos en el mismo post)" class="cBtn"><img src="https://k61.kn3.net/9/1/B/B/B/E/F0B.png" height="24" width="24"></button>' +
  27. '<button id="compartir" title="Compartir la pagina en donde estamos" class="cBtn"><img src="https://k61.kn3.net/6/F/7/D/4/D/ABF.png" height="24" width="24"></button>' +
  28. '<button id="scroll" class="cBtn" title="¡Subir Arriba!"><img src="http://o1.t26.net/img/arrowtop.png" height="24" width="24"></button>'+
  29. '</div>');
  30.  
  31.  
  32. }
  33. $('#reload').on('click', function(){
  34. location.reload(true);
  35. });
  36. $('#likeador').on('click', function(){
  37. $(".require-login.button-action-s.action-vote.hastipsy.pointer").click();
  38. });
  39. $('#scroll').click(function() {
  40. scrollTo(0, 0);
  41. });
  42. $('#compartir').on('click', function(){
  43. var link = ''+document.URL+'';
  44. var cont;
  45. $.ajax({
  46. type : 'POST',
  47. dataType: 'json',
  48. url : '/ajax/shout/attach',
  49. data : {
  50. url : link
  51. },
  52. success: function(data){
  53. $.ajax({
  54. type : 'POST',
  55. dataType : 'json',
  56. url : '/ajax/shout/add',
  57. data : {
  58. key : global_data.user_key,
  59. body : cont,
  60. privacy : 0,
  61. attachment_type : 3,
  62. attachment : data.data.id
  63.  
  64. }
  65. });
  66. },
  67. error: function(){
  68. alert('¡Error, no se pudo compartir el link, intente nuevamente!');
  69. },
  70. complete: function(){
  71. console.info('¡Listo!');
  72. }
  73. });
  74.  
  75. });
  76. $('#recomendar').on('click', function() {
  77. var link = ''+document.URL+'';
  78. var usuario = $('.user.textlimit.truncate').text();
  79. var cont = '['+'['+'['+'['+ usuario +']'+']'+']'+']\n'+'@'+ usuario +'';
  80. $.ajax({
  81. type : 'POST',
  82. dataType: 'json',
  83. url : '/ajax/shout/attach',
  84. data : {
  85. url : link
  86. },
  87. success: function(data){
  88. $.ajax({
  89. type : 'POST',
  90. dataType : 'json',
  91. url : '/ajax/shout/add',
  92. data : {
  93. key : global_data.user_key,
  94. body : cont,
  95. privacy : 0,
  96. attachment_type : 3,
  97. attachment : data.data.id
  98.  
  99. }
  100. });
  101. },
  102. error: function(){
  103. alert('¡Error, no se pudo compartir el post, intente nuevamente!');
  104. },
  105. complete: function(){
  106. console.info('¡Listo!');
  107. }
  108. });
  109. });
  110. }
  111. console.info('-¿Para que nos caemos? -Para aprender a levantarnos.');
  112. setInterval(console.clear(), 5000);
  113.  
  114. cazaTools();
  115. })(jQuery);