// ==UserScript==
// @name 百度删帖管理
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *tieba.baidu.com/pmc*
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
var url = window.location.href.split("?")[0];
if(url.length == url.indexOf("pmc") + 3){
window.location.href = "http://tieba.baidu.com/pmc/recycle?tab=system";
}
// 0:都隐藏,1:不隐藏,2:隐藏已删除,3:隐藏恢复中
// 读取cookie
var hideNum = Number(getCookie("hideNum")) || 0;
// 是否隐藏已删除(根据cookie)
var hideCantSave = isNaN(hideNum) ? true : hideNum % 2 == 0;
// 是否隐藏申诉中(根据cookie)
var hideSaving = isNaN(hideNum) ? true : hideNum % 3 == 0;
// 已删除列表(本地)
var hideList = [
"相信我,这东西销量一定不怎么好",
"我在模拟器上也遇到过这种问题",
"经常坐飞机的人就知道20100表示什么了",
"回复 不单推百合娘ლ :",
"看样子阁下不在国内",
"在下试了很多威屁恩,所有11区节点全部",
"我在模拟器上也遇到过这种问题,",
"相信我,这东西销量一定不怎么好
然"
];
function isInArray(array, item){
if(array.length > 0){
for(var i = 0; i < array.length; i++){
if(item.indexOf(array[i]) > -1){
return true;
}
}
}
return false;
}
function addCookie(objName,objValue,objDays){ // objDays = 不填/数字/Infinity
var str = objName + "=" + escape(objValue);
if(objDays > 0){
var date = new Date();
var ms = objDays*24*3600*1000;
date.setTime(date.getTime() + ms);
str += "; expires=" + date.toGMTString();
}
if(objDays===Infinity){
str += "; expires=Fri, 31 Dec 9999 23:59:59 GMT";
}
str += "; path=/";
document.cookie = str;
}
function getCookie(name){
var arr, reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if((arr = document.cookie.match(reg))){
return unescape(arr[2]);
}else {
return null;
}
}
var btn1 = "隐藏已删除";
var btn2 = "隐藏恢复中";
$("div.panel_notice").after("