Skip to content

Instantly share code, notes, and snippets.

@koooyama
koooyama / gist:2984507
Last active October 6, 2015 11:08
Twitterの日本語大喜利hashtag用正規表現
#(.+に.+を(つ|着|付|入).+ると|.+を.+に(す|してみ)る|.+に.+れたら|.+人RT|お前ら|フォロワー)
// ==UserScript==
// @name kill ondragstart oncontextmenu onselectstart
// @namespace http://d.hatena.ne.jp/kei_koyama/
// @include *
// ==/UserScript==
(function() {
document.body.setAttribute('ondragstart','');
document.body.setAttribute('oncontextmenu','');
document.body.setAttribute('onselectstart','');
javascript:(function(){function%20$x(xpath){var%20tmp=document.evaluate(xpath,document.documentElement,document.createNSResolver(document.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var%20result=new%20Array();for(var%20i=0;i<tmp.snapshotLength;i++){result.push(tmp.snapshotItem(i));}return%20result;}var%20xpt='//table[@class="list_desc_innertable_text"]//tr[th[text()="<>"]]//td';var%20title=$x(xpt.replace(/<>/,'%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB')+'/font')[0].innerHTML;var%20circle=$x(xpt.replace(/<>/,'%E3%82%B5%E3%83%BC%E3%82%AF%E3%83%AB')+'//a')[0].innerHTML;var%20genre=$x(xpt.replace(/<>/,'%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%AB')+'//a')[0].innerHTML;var%20author=$x(xpt.replace(/<>/,'%E4%BD%9C%E3%80%80%E5%AE%B6')+'//a')[0].innerHTML;location.href='http://clip.livedoor.com/clip/add?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent('[MelonBooks]%20'+title)+'&tags='+encodeURIComponent('%e5%90%8c%e4%ba%ba%e8%aa%8c%20'+genre+'%20'+circle+'%20'+author)+'&jump=myclip';})();