Created
September 26, 2017 22:55
-
-
Save rhoaias2017/d7d26de6f1af6b6af4d2827a1d3262e1 to your computer and use it in GitHub Desktop.
十字加随机签名档
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://www.mitbbs.com/mwap/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
reply_submit = function() { | |
var board = $('#board').html(); | |
var groupid = $('#groupid').html(); | |
var title = $('#title').html(); | |
var re_content = $('#re_content').html(); | |
var searchableStr = document.URL + '&'; | |
var group_id = searchableStr.match (/[\?\&]group_id=([^\&\#]+)[\&\#]/i) [1]; | |
var father_page = "http://www.mitbbs.com/mwap/forum/article.php?board=" + board + "&groupid=" + group_id + "&content_type=all"; | |
$.ajax({ | |
url: "https://api.forismatic.com/api/1.0/", | |
jsonp: "jsonp", | |
dataType: "jsonp", | |
data: { | |
method: "getQuote", | |
lang: "en", | |
format: "jsonp" | |
} | |
}) | |
.done(function(post) { | |
var sig = "<p>\n<b>" + post.quoteText + "</b>\n " + post.quoteAuthor + "\n</p>"; | |
var obj = document.getElementById("text_"+groupid); | |
var content = obj.value; | |
content = content+"\n"+re_content + "\n" + sig; | |
post_article(board, title, groupid, content, "0", father_page); | |
}); | |
return false; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment