cazaTools

Herramientas para automatizar acciones en Taringa.net.

目前為 2016-12-10 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         cazaTools
// @namespace    CazaTools
// @version      0.3
// @description  Herramientas para automatizar acciones en Taringa.net.
// @author       @Cazador4ever - @EdvardGrieg
// @match        http*://www.taringa.net/mi
// @include      http*://www.taringa.net/posts/*
// @include      http*://www.taringa.net/*
// @grant        none
// ==/UserScript==

(function($) {
    'use strict';
    function cazaTools() {
        function getRnd(arr) {
            return arr[Math.floor(Math.random() * arr.length)];
        }
        var exists = !!$('#cazaTools').length;
        if ( !exists ) {
            $('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>' +
                             '<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>' +
                             '<div id="cazaTools" class="cTools" style="position: fixed;">' +
                             '<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>' +
'<button id="save" title="Guardar la apgina en archive.is" class="cBtn"><img src="http://www.scienceclass411.com/images/stylistica-icons-set/png/128x128/save.png" height="24" width="24"></button>'+
                             '<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>' +
                             '<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>' +
                             '<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>' +
                             '<button id="scroll" class="cBtn" title="¡Subir Arriba!"><img src="http://o1.t26.net/img/arrowtop.png" height="24" width="24"></button>'+
                             '</div>');


        }
        $('#reload').on('click', function(){
            location.reload(true);
        });
$('#save').on('click', function(){
            void(open('https://archive.is/?run=1&url='+encodeURIComponent(document.location)));
        $('#likeador').on('click', function(){
            $(".require-login.button-action-s.action-vote.hastipsy.pointer").click();
        });
        $('#scroll').click(function() {
            scrollTo(0, 0);
        });
        $('#compartir').on('click', function(){
            var link = ''+document.URL+'';
            var cont;
            $.ajax({
                type    : 'POST',
                dataType: 'json',
                url     : '/ajax/shout/attach',
                data    : {
                    url : link
                },
                success: function(data){
                    $.ajax({
                        type     : 'POST',
                        dataType : 'json',
                        url      : '/ajax/shout/add',
                        data     : {
                            key             : global_data.user_key,
                            body            : cont,
                            privacy         : 0,
                            attachment_type : 3,
                            attachment      : data.data.id

                        }
                    });
                },
                error: function(){
                    alert('¡Error, no se pudo compartir el link, intente nuevamente!');
                },
                complete: function(){
                    console.info('¡Listo!');
                }
            });

        });
        $('#recomendar').on('click', function() {
            var link = ''+document.URL+'';
            var usuario = $('.user.textlimit.truncate').text();
            var cont = '['+'['+'['+'['+ usuario +']'+']'+']'+']\n'+'@'+ usuario +'';
            $.ajax({
                type    : 'POST',
                dataType: 'json',
                url     : '/ajax/shout/attach',
                data    : {
                    url : link
                },
                success: function(data){
                    $.ajax({
                        type     : 'POST',
                        dataType : 'json',
                        url      : '/ajax/shout/add',
                        data     : {
                            key             : global_data.user_key,
                            body            : cont,
                            privacy         : 0,
                            attachment_type : 3,
                            attachment      : data.data.id

                        }
                    });
                },
                error: function(){
                    alert('¡Error, no se pudo compartir el post, intente nuevamente!');
                },
                complete: function(){
                    console.info('¡Listo!');
                }
            });
        });
    }
    console.info('-¿Para que nos caemos? -Para aprender a levantarnos.');
    setInterval(console.clear(), 5000);

    cazaTools();
})(jQuery);