Last active
March 16, 2016 18:25
-
-
Save Liandriz/efc4de301ab075f06924 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 tagSubscribe | |
// @namespace log.kcars | |
// @include http://oreno.imouto.org/* | |
// @include http://danbooru.donmai.us/* | |
// @include http://konachan.com/* | |
// @include http://chan.sankakucomplex.com/* | |
// From https://gist.github.com/Kcars/1291050 adding .user | |
// ==/UserScript== | |
var jq = document.createElement("script") ; | |
jq.src = 'http://jquery.com/src/jquery-latest.js' ; | |
jq.type = "text/javascript" ; | |
document.getElementsByTagName("head")[0].appendChild(jq) ; | |
function loading() | |
{ | |
if(typeof unsafeWindow.jQuery == "undefined") | |
{ | |
window.setTimeout(loading , 100) ; | |
} | |
else | |
{ | |
$ = unsafeWindow.jQuery ; | |
start() ; | |
} | |
} | |
loading() ; | |
function onClickSubscriber(event) | |
{ | |
} | |
function start() | |
{ | |
var host = location.hostname ; | |
var feed = "" ; | |
if(host.search("oreno") != -1) | |
{ | |
feed = "http://oreno.imouto.org/post/atom?tags=" ; | |
} | |
if(host.search("danbooru") != -1) | |
{ | |
feed = "http://danbooru.donmai.us/post/atom?tags=" ; | |
} | |
if(host.search("konachan") != -1) | |
{ | |
feed = "http://http://konachan.com/post/atom?tags=" ; | |
} | |
if(host.search("sankakucomplex") != -1) | |
{ | |
feed = "http://chan.sankakucomplex.com/post/atom?tags=" ; | |
} | |
$("#tag-sidebar li").each(function() | |
{ | |
if(host.search("danbooru") != -1) | |
{ | |
var tag = $(this).find("a")[1].textContent ; | |
} | |
else | |
{ | |
var tag = $(this).find("a")[3].textContent ; | |
} | |
tag = tag.replace(/[ ]/g , "_") ; | |
$(this).append("<a href=\"" + feed + tag + "\">" + "RSS" + "</a>") ; | |
}) ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment