Difference between revisions of "User:Zak Renfew/monobook.js"
Jump to navigation
Jump to search
Zak Renfew (talk | contribs) (Blanked the page) |
Zak Renfew (talk | contribs) (from http://userscripts.org/scripts/review/12075) |
||
Line 1: | Line 1: | ||
// ==UserScript== | |||
// @namespace whatisthis? | |||
// @name Google in Wikipedia | |||
// @description Inserts links to Google web and images searches related to the Wikipedia Articles | |||
// @include http://*.wikipedia.org/wiki/* | |||
// ==/UserScript== | |||
var para=document.getElementsByTagName('h3'); | |||
//get url | |||
var fullurl = window.location.href; | |||
var head = fullurl.replace(fullurl.substring(0,fullurl.search(/org/)+9) , ""); | |||
//get rid of the underscores | |||
head = head.replace(/_/g , " "); | |||
head = escape(head); | |||
//write everthing to page | |||
para[0].innerHTML= | |||
//Search engines | |||
'Search: '+ | |||
'<a href="http://www.google.com/search?hl=en&lr=&q='+head+'&btnG=Search"> Google</a>'+ | |||
'<a href="http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search='+head+'&fulltext=Search">Wikipedia</a>'+ | |||
para[0].innerHTML; |
Revision as of 09:20, 20 April 2010
// ==UserScript==
// @namespace whatisthis?
// @name Google in Wikipedia
// @description Inserts links to Google web and images searches related to the Wikipedia Articles
// @include http://*.wikipedia.org/wiki/*
// ==/UserScript==
var para=document.getElementsByTagName('h3');
//get url
var fullurl = window.location.href;
var head = fullurl.replace(fullurl.substring(0,fullurl.search(/org/)+9) , "");
//get rid of the underscores
head = head.replace(/_/g , " ");
head = escape(head);
//write everthing to page
para[0].innerHTML=
//Search engines
'Search: '+
'<a href="http://www.google.com/search?hl=en&lr=&q='+head+'&btnG=Search"> Google</a>'+
'<a href="http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search='+head+'&fulltext=Search">Wikipedia</a>'+
para[0].innerHTML;