Skip to content

Instantly share code, notes, and snippets.

@makimoto
Created October 26, 2013 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makimoto/7166125 to your computer and use it in GitHub Desktop.
Save makimoto/7166125 to your computer and use it in GitHub Desktop.
// ==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