// @version 0.3
// ==/UserScript==
-_log = console.log; // TODO: check GM_log
+_log = function(x) {
+ try {
+ console.log(x);
+ } catch(e) {
+ }
+};
ARCHIVFORUMID = 35;
boardurl = "/forum/";
user_id = "18865";
}
function get_thread_id() {
- return window.location.search.match('t=([0-9]+)')[1];
+ return window.location.search.match(/t=([0-9]+)/)[1];
}
function get_forum_id() {
- return window.location.search.match('f=([0-9]+)')[1];
+ return window.location.search.match(/f=([0-9]+)/)[1];
}
function get_session_id() {
- return $("a[href*='?sid']:last").attr("href").match("sid=([a-z0-9]+)")[1];
+ return $("a[href*='?sid']:last").attr("href").match(/sid=([a-z0-9]+)/)[1];
}
function removepost(event) {
_log(a, b, c);
},
success: function(data, status) {
- key = data.match("confirm_key=([A-Z0-9]+)")[1];
+ key = data.match(/confirm_key=([A-Z0-9]+)/)[1];
_removepost(post_id, key);
}
}
"redirect": "/",
"sess": get_session_id(),
"start": "0",
- "subject": "[spam] " + $('#page-body h2').text(),
+ "subject": "[spam] " + $('#page-body').find('h2').text(),
"t": thread_id,
"to_forum_id": ARCHIVFORUMID
- }
+ };
$.ajax(
{