Find All posts in PostActivity

posts in PostActivity

当前为 2015-08-01 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Find All posts in PostActivity
// @namespace    http://saadtronics.com/
// @version      1.1
// @description      posts in PostActivity
// @author       Saad Tronics (King of Hearts, saadtronics)
// @match        http://www.hackforums.net/postactivity.php*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @grant        none
// ==/UserScript==

$(document).ready(function(){
    
    var username = $('#content > div.navigation > span > a').html();
    
    console.log('hello');
    var navBit = document.getElementsByClassName('navigation')[0];          
    var postkey = ($('[name="my_post_key"]').val());
    var table=document.querySelector("div.quick_keys table");
    var x = table.rows[1].insertCell(1);
    x.innerHTML = "Find all threads";
    x.className="tcat";
    var x = table.rows[1].insertCell(2);
    x.innerHTML = "Find all posts";
    x.className="tcat";

    for(var i = 2; i < table.rows.length; i++){
        var x = table.rows[i].insertCell(1);
        var forumId = table.rows[i].cells[0].innerHTML.match(/fid=(.*)">/)[1];
        var form = '<form action="search.php" method="post"><input type="hidden" name="action" value="do_search"> <input type="hidden" name="keywords" value=""> <input type="hidden" name="postthread" value="2"> <input type="hidden" name="author" value="'+username+'"> <input type="hidden" name="matchusername" value="1"> <input type="hidden" name="forums[]" value="'+forumId+'"> <input type="hidden" name="findthreadst" value="1"> <input type="hidden" name="numreplies" value=""> <input type="hidden" name="postdate" value="0"> <input type="hidden" name="pddir" value="1"> <input type="hidden" name="threadprefix" value="any"> <input type="hidden" name="sortby" value="lastpost"> <input type="hidden" name="sortordr" value="desc"> <input type="hidden" name="showresults" value="threads"> <input type="submit" name="submit" value="Find All Threads"></form>';
        x.innerHTML = form;
        x.className="tcat";

        var z = table.rows[i].insertCell(2);
        var form = '<form action="search.php" method="post"><input type="hidden" name="action" value="do_search"> <input type="hidden" name="keywords" value=""> <input type="hidden" name="postthread" value="2"> <input type="hidden" name="author" value="'+username+'"> <input type="hidden" name="matchusername" value="1"> <input type="hidden" name="forums[]" value="'+forumId+'"> <input type="hidden" name="findthreadst" value="1"> <input type="hidden" name="numreplies" value=""> <input type="hidden" name="postdate" value="0"> <input type="hidden" name="pddir" value="1"> <input type="hidden" name="threadprefix" value="any"> <input type="hidden" name="sortby" value="lastpost"> <input type="hidden" name="sortordr" value="desc"> <input type="hidden" name="showresults" value="posts"> <input type="submit" name="submit" value="Find All Posts"></form>';
        z.innerHTML = form;
        z.className="tcat";

    }

});