User:Tanyasingh/scripts/SearchHelper.js

/* Copied from https://en.wikipedia.org/wiki/User:Titodutta/scripts/SearchHelper.js to access http://tito-dutta.my3gb.com/IndianEnglishNewspapersSearch.html The script adds a few options beside article Main script by Writ and may be seen at https://en.wikipedia.org/wiki/User:Writ_Keeper/Scripts/googleTitle.js { if(mw.config.get("wgCanonicalNamespace") == "") {			var subjectName; var pageName = mw.config.get("wgPageName"); if(pageName.charAt(pageName.length - 1) == ")")			{				subjectName = pageName.substring(0, pageName.lastIndexOf("(") - 1); }			else {				subjectName = pageName; }
 * /$(document).ready(function

var newNode = "  WRS "; /*WRS from User:Sam Sailor/Scripts/WRStitle.js*/ $("#firstHeading").append(newNode);

var newNode = "  Google search " $("#firstHeading").append(newNode);

var newNode = "  Google News " $("#firstHeading").append(newNode);

var newNode = "  Google Books " $("#firstHeading").append(newNode);

var newNode = "  Google images " $("#firstHeading").append(newNode);

var newNode = "  Yahoo " $("#firstHeading").append(newNode);

var newNode = "  DuckDuckGo " $("#firstHeading").append(newNode);

var newNode = "  YouTube " $("#firstHeading").append(newNode);

var newNode = " <a href='https://commons.wikimedia.org/w/index.php?search=" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> Commons </a>" $("#firstHeading").append(newNode);

var newNode = " <a href='http://www.flickr.com/search/?l=commderiv&q=" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> Flickr (CC) </a>" $("#firstHeading").append(newNode);

var newNode = " <a href='https://www.imdb.com/find?q=" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> IMDb </a>" $("#firstHeading").append(newNode);

var newNode = " <a href='https://www.jstor.org/action/doBasicSearch?Query=" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> JSTOR </a>" $("#firstHeading").append(newNode);

var newNode = " <a href='http://edwardbetts.com/find_link/" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> Find link </a>" $("#firstHeading").append(newNode);

var newNode = " <a href='https://www.google.com/custom?hl=en&cx=014196815420355252912:fownxmjrhle&cof=FORID%3A13%3BAH%3Aleft%3BCX%3AWikipedia%2520Reference%2520Search&q=" + encodeURIComponent(subjectName.replace(/_/g, " ")).replace(/'/g,"%27") + "' target='_blank'> Indian newspapers </a>"; $("#firstHeading").append(newNode);

} }); if ( $('#t-wikibase').length ){	console.log('Exist');	link = $('li#t-wikibase a:first').attr('href');	console.log( link ); }

$(document).ready(function {		if(mw.config.get("wgCanonicalNamespace") == "" && $('#t-wikibase').length )		{			console.log('Exist');			link = $('li#t-wikibase a:first').attr('href');

var newNode = "<a href='" + link + "' target='_blank'> Wikidata </a>"; $("#firstHeading").append(newNode); } });