Created
October 26, 2013 06:55
-
-
Save makimoto/7166125 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 W and G for Y!100 | |
// @namespace http://d.hatena.ne.jp/makimoto/ | |
// @description Making links to Wikipedia (ja) and Google Search in Yahoo! Hyakka-jiten (Encyclopedia) | |
// @include http://100.yahoo.co.jp/* | |
// @require http://jqueryjs.googlecode.com/files/jquery-1.2.6.js | |
// ==/UserScript== | |
jQuery(function(){ | |
w = 'http://ja.wikipedia.org/w/index.php?title=%E7%89%B9%E5%88%A5%3A%E6%A4%9C%E7%B4%A2&ns0=1&search=' | |
G = 'http://www.google.co.jp/search?q=' | |
jQuery('a[href^="http://100.yahoo.co.jp/detail/"]').each(function() { | |
url = this['href']; | |
q = url.slice(30,-1); | |
t = jQuery(this); | |
t.after('<span style="font-size:70%;">[<a href="'+w+q+'">W</a>][<a href="'+g+q+'">G</a>]</span> '); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment