PPT.cc 圖床 自動送密碼

try to take over the world!

目前为 2019-07-12 提交的版本。查看 最新版本

// ==UserScript==
// @name         PPT.cc 圖床 自動送密碼
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ppt.cc/*
// @grant        none
//@require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==

(function() {
    'use strict';
   // 增加一個redirect的語法
$.extend(
{
    redirectPost: function(location, args)
    {
        var form = '';
        $.each( args, function( key, value ) {
            form += '<input type="hidden" name="'+key+'" value="'+value+'">';
        });
        $('<form action="'+location+'" method="POST">'+form+'</form>').appendTo('body').submit();
    }
});

   //取得queryString,密碼和是否已經發送
    var password = getParameterByName("password");
    var isSend =  getParameterByName("send");
    if(password && !isSend)
    {
        var cleanUrl = window.location.href.split('?')[0];
        $.redirectPost(window.location.href+"&send=1", { t:2,p:password,ga:1,url:cleanUrl,cleanUrl:"我要通關" } );
    }

})();

function getParameterByName(name) {
    var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}