Remove Pesonalised Search Greasemonkey Script

I just knocked up a quick Greasemonkey script to add a “Remove customisations” link next to the “View customizations” (customisations) link that appears when Google is tailoring your results based on your search history.

This is particularly useful if, like me, you want to know when this kind of thing is happening and need and quick way to remove it.  Yes, you can disable it but this gives you a more granular option.

So, here you go..

// ==UserScript==
// @name           Remove Google Customisations
// @description    Adds link to remove personal customisations from Google searches
// @include        http://www.google.co.uk/search?*q=*
// ==/UserScript==

window.addEventListener('load', function() {
	var d=document;
	var n;var as=d.getElementsByTagName('a');
	for(var i=0;i<as.length;i++){
		if(/View customi(s|z)ations/.test(as[i].textContent)){
			n=as[i];
			break;
		}
	}
	if(n){
		var a=d.createElement('a');
		a.href=d.location.href+'&pws=0';
		a.innerHTML='Remove customisations';
		n.parentNode.insertBefore(a,n.parentNode.firstChild);
	}
}, true);

That should do it.. I do have a bookmarklet version to if anyone wants it posted.

add to del.icio.us :: Bookmark Post in Technorati :: Add to Blinkslist :: add to furl :: Digg it :: add to ma.gnolia :: Stumble It! :: add to simpy :: seed the vine :: :: :: TailRank :: post to facebook :: Bookmark on Google :: Add to Netscape :: Share on Yahoo :: Add this to Live

Advertisements

Google Map UK Postcodes Bookmarklet

Today I found a really neat use for my Get Elements By Content function which I wrote recently.  I wanted to create a bookmarklet that allowed me to visit a page, click on the link and turn any UK postcodes in the page to a link to a Google Map.  Well, it’s pretty simple –

var pc=gbc('[a-z]{1,2}\\d{1,2}[a-z]? \\d[a-z]{2}');
for(var i=0;i<pc.length;i++){
 pc[i].innerHTML=pc[i].innerHTML.replace(/([a-z]{1,2}\d{1,2}[a-z]? \d[a-z]{2})/ig,'<a href="http://maps.google.co.uk/maps?f=q&hl=en&q=$1,UK&ie=UTF8&z=16&om=1&iwloc=addr">$1</a>');
}

Obviously you need to ‘gbc’ function from my last post, but other than that, you just need to turn it into a bookmarklet and away you go. If you have any problems, let me know.

add to del.icio.us :: Bookmark Post in Technorati :: Add to Blinkslist :: add to furl :: Digg it :: add to ma.gnolia :: Stumble It! :: add to simpy :: seed the vine :: :: :: TailRank :: post to facebook :: Bookmark on Google :: Add to Netscape :: Share on Yahoo :: Add this to Live

Hosted wordpress social bookmarks bookmarklet

As I use Google Chrome as my default browser nowadays, I don’t currently have access to greasemonkey (userscripts are coming in 2.0 though :)) and therefore I can’t use my hosted wordpress social bookmarks greasemonkey script. For this reason (and for others who don’t use firefox*), I’ve knocked up a bookmarklet version of the script.

Given that it’s really diffcult to format code correctly in here, I’ll just point you to it as a file.  Just grab the file and and copy the contents as the location of a bookmark (preferably one on you bookmarks bar so you have easy access to it).  Then, whenever you’re on the add or edit post pages in your wordpress admin, you can click the link to add in the nifty “Social Bookmarks” section as if you were using the greasemonkey version.

Neat.

*Apart from those using IE as it seems to truncate all bookmarks longer than a predetermined max… what a PITA.

add to del.icio.us :: Bookmark Post in Technorati :: Add to Blinkslist :: add to furl :: Digg it :: add to ma.gnolia :: Stumble It! :: add to simpy :: seed the vine :: :: :: TailRank :: post to facebook :: Bookmark on Google :: Add to Netscape :: Share on Yahoo :: Add this to Live