Last active
October 20, 2016 07:59
-
-
Save synr/8e6e455bd2ee8ec0e63dfc7b186e1770 to your computer and use it in GitHub Desktop.
[取得 Markdown 格式的連結](壓縮板,已修正 youtube 問題)
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
javascript:for(var a=0,b="",c=document.getElementsByTagName("link"),d=c.length;d--;)"shortlink"==c[d].rel&&(b=c[d].href);-1!=location.href.indexOf("//www.youtube.com/watch?")&&(b=location.href.replace(/.*youtube\.com\/watch\?v=(.*)\&(.*)/,"https://youtu.be/$1?$2"));if(-1!=location.href.indexOf("//www.pixiv.net/member.php?id="))for(c=document.getElementsByTagName("input"),d=c.length;d--;)if(/http\:\/\/pixiv\.me\/.*/.test(c[d].value)){b=""==b?c[d].value:b;break} if(-1!=location.href.indexOf("//www.pixiv.net/member_illust.php?"))for(var c=document.getElementsByTagName("link"),d=c.length,e=0<document.getElementsByTagName("html")[0].lang.length?document.getElementsByTagName("html")[0].lang:"";d--;)if("en"==c[d].hreflang){b=""==b?c[d].href.replace(/www(\.pixiv\.com)/,e+"$1"):b;break} if(-1!=location.href.indexOf("//dic.nicovideo.jp"))for(c=document.getElementsByTagName("a"),d=c.length;d--;)if(/.*\/id\/(\d+)/.test(c[d].href)){b=""==b?c[d].href.replace(/.*\/id\/(\d+)/,"http://nico.ms/dic/$1"):b;break} var f=(""==b?location.href.replace(/https?\:\/\/www\.nicovideo\.jp\/watch\//,"http://nico.ms/").replace(/https?\:\/\/seiga\.nicovideo\.jp\/(seiga|watch)\//,"http://nico.ms/").replace(/https?\:\/\/live\.nicovideo\.jp\/watch\//,"http://nico.ms/").replace(/https?\:\/\/com\.nicovideo\.jp\/community\//,"http://nico.ms/").replace(/https?\:\/\/ch\.nicovideo\.jp\/.*\/blomaga\/(ar.*)/,"http://nico.ms/$1").replace(/https?\:\/\/chokuhan\.nicovideo\.jp\/products\/detail\/(\d*)/,"http://nico.ms/nd$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(az.*)/, "http://nico.ms/$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(ysamiami.*)/,"http://nico.ms/$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(ggbo.*)/,"http://nico.ms/$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(ndsupplier.*)/,"http://nico.ms/$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(dw.*)/,"http://nico.ms/$1").replace(/https?\:\/\/ichiba\.nicovideo\.jp\/item\/(it.*)/,"http://nico.ms/$1").replace(/https?\:\/\/app\.nicovideo\.jp\/app\/(ap.*)/,"http://nico.ms/$1").replace(/https?\:\/\/jk\.nicovideo\.jp\/watch\/(jk.*)/, "http://nico.ms/$1").replace(/https?\:\/\/commons\.nicovideo\.jp\/material\/(nc.*)/,"http://nico.ms/$1").replace(/https?\:\/\/news\.nicovideo\.jp\/watch\/(nw.*)/,"http://nico.ms/$1").replace(/https?\:\/\/www\.nicovideo\.jp\/(user\/\d*)/,"http://nico.ms/$1").replace(/https?\:\/\/www\.nicovideo\.jp\/(mylist\/\d*)/,"http://nico.ms/$1").replace(/https?\:\/\/www\.nicovideo/,"http://nicovideo").replace(/https?\:\/\/www\.facebook\.com/,"http://fb.com").replace(/https?\:\/\/www\.pixiv\.net\/member\.php\?id\=/, "http://p.tl/m/").replace(/https?\:\/\/www\.pixiv/,"http://pixiv").replace("http://bangumi.tv","http://bgm.tv").replace(/https?\:\/\/www\.bilibili\.com/,"http://acg.tv").replace(/(https?:\/\/trello\.com\/(c|b)\/.*)\/.*/,"$1").replace(/(https?)\:\/\/www\.plurk/,"$1://plurk").replace(/(https?)\:\/\/www\.playpcesor/,"$1://playpcesor").replace(/:\/\/.*\.(googledrive\.com.{0,})/,"://$1"):b)+"",g=document.title.replace(/( - \u30cb\u30b3\u30cb\u30b3\u52d5\u753b:GINZA| \u2010 \u30cb\u30b3\u30cb\u30b3\u52d5\u753b:GINZA| \u2010 niconico\u52d5\u756b:GINZA| - Niconico Douga: Ginza)/, "").replace(/( - \u54d4\u54e9\u54d4\u54e9 - \( \u309c- \u309c\)\u3064\u30ed \u4e7e\u676f~ - bilibili| - \u55f6\u54e9\u55f6\u54e9 - \( \u309c- \u309c\)\u3064\u30ed \u4e7e\u676f~ - bilibili)/,"").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\./g,"\\.").replace(/http\:/g,"http\\:").replace(/https\:/g,"https\\:").replace(/\_/g,"\\_").replace(/\#/g,"\\#").replace(/\*/g,"\\*"),h=window.prompt("\u9019\u662f\u76ee\u524d\u7db2\u9801\u7684\u6a19\u984c + \u7db2\u5740\u3002\n\u4e26\u4ee5 Markdown \u7684\u8a9e\u6cd5\u5beb\u6210\u9023\u7d50\u3002"+ (-1!=location.href.indexOf("//www.nicovideo.jp")||-1!=location.href.indexOf("//nico.ms")?"\n\n\u53e6\u5916\u6a19\u984c\u5df2\u81ea\u52d5\u6392\u9664\u90e8\u5206\u5b57\u6a23\uff1a\n\u300c - \u30cb\u30b3\u30cb\u30b3\u52d5\u753b:GINZA\u300d":""),"["+g+"]("+f+")");null==h&&(a=0);null!=navigator.userAgent.match("MSIE")&&null!=h&&""!=h&&window.clipboardData.setData("Text",h);console.log(h); if(1==a){var k=getSelection?getSelection().toString():"";-1!=location.href.indexOf("//www.youtube.com/watch?")&&(f=location.href);var l=window;l.open("https://trello.com/add-card?source="+l.location.host+"&mode=popup&url="+encodeURIComponent(f)+(g?"&name="+encodeURIComponent(g):"")+"&desc="+(encodeURIComponent("- ["+g+"]("+f+")")+(k?encodeURIComponent("\n\n----\n\n ```\n"+k+"\n```"):"")),"add-trello-card","width=500,height=600,left="+(l.screenX+(l.outerWidth-500)/2)+",top="+(l.screenY+(l.outerHeight- 740)/2))}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment