Fastladderã§LDRã®ã¯ãã¼ã©ã使ãGreasemonkey
追è¨:console.logã¨ããæ®ã£ã¦ãã®ã§ãgistã®ã»ãã¯ç´ãã¦ãããã
ããã¤ã³ã¹ãã¼ã«ã
LDRã®ç»é¢ãçãã¦å«ã§Fastladderã«ä¹ãæãããã¨ãããã©ãLDRã¨æ¯è¼ãã¦ã¯ãã¼ã©ã®å·¡åãé
ãã¦å°ã£ã¦ããåã®ããã«ã
// ==UserScript== // @name FastLDR // @namespace http://d.hatena.ne.jp/javascripter/ // @include http://fastladder.com/reader/ // ==/UserScript== var native_post = unsafeWindow.API.prototype.post; var api_key = null; GM_xmlhttpRequest({ method: "GET", url: "http://reader.livedoor.com/reader/", onload: function (res) { var m = res.responseText.match(/^var ApiKey = "(.*)";/m); if (m) { api_key = m[1]; } else { unsafeWindow.message("API key not found.(Please login to LDR)"); } } }); unsafeWindow.API.prototype.post = function(param, onload){ if (/^\/api\/config\//.test(this.ap)) { return native_post.apply(this, arguments); } unsafeWindow.console.log(api_key); var onload = onload || this.onload; var oncomplete = this.onComplete; if (typeof onload != "function") { onload = function() {}; } param.ApiKey = api_key; setTimeout(GM_xmlhttpRequest, 0, { method: "post", url: "http://reader.livedoor.com/" + this.ap, data: unsafeWindow.Object.toQuery(param), headers: { "Content-Type" : "application/x-www-form-urlencoded" }, onload: function(res) { oncomplete(); unsafeWindow.API.last_response = res.responseText; var json = unsafeWindow.JSON.parse(res.responseText); if (json) { onload(json); } else { unsafeWindow.message("can't load data"); unsafeWindow.show_error(); } } }); this.onCreate(); return this; };