Sep 18

The other day I ran across an interesting post by Steve Rubel about Google’s real-time searching capabilities(LINK). He made a bookmarklet that enables you to enter a search term that will take you to a webpage that will show you anything relevant to that search from the last ten minutes.

Here is his bookmarklet:
javascript:(function()%7B%20p=prompt('Search%20term:',' ');%20if(p)%7B%20document.location.href='http://www.google.com/search?as_qdr=n10&q='%20+%20escape(p)%7D%20%7D)();

To use it you need to make a new bookmark in your browser and then copy and paste this code where you would usually have the http://website.com information in the bookmark editor.

I had some fun with his little piece of javascript and made a couple of my own. The first one that I reverse engineered was for Delicious.com.

I use delicious.com all the time for getting back to webpages where I forgot the links. Typically I would type: http://delicious.com/newhighscore/insert-a-tag-name-here – but with this bookmarklet I can just click the bookmarklet in my browser and enter a tag name to go to a page listing those links.

Here is the code for that bookmarklet:
javascript:(function()%7B%20p=prompt('Delicious%20Search%20term:','');
%20if(p)%7B%20document.location.href='http://www.delicious.com/
newhighscore/'%20+%20escape(p)%7D%20%7D)();

To use this one all you need to do is create a bookmarklet and replace the newhighscore text with the name that you use on delicious.com

The only other one that I’ve made so far is for unshortening a shortened link. I normally use greasemonkey to automatically unshorten links on web pages, but this bookmarklet has come in handy. I use the http://therealurl.appspot.com/website to convert the shortened links so at the moment this bookmarklet takes you to a webpage that just displays the unshortened link.

Here is the code:
javascript:(function()%7B%20p=prompt('Link%20to%20expand:','');%20if(p)%
7B%20document.location.href='http://therealurl.appspot.com/?url='%20+%20escape(p)%7D%20%7D)();

To finish up, here is one more that is taken from the Delicious web site.
javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent
(document.title)+'&v=5&';a=function(){if(!window.open
(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,
scrollbars=no,toolbar=no,width=550,height=550'))location.href=
f+'jump=yes'};if(/Firefox/.test(navigator.userAgent))
{setTimeout(a,0)}else{a()}})()

When you click this bookmarklet it gives a pop-up that lets you save a bookmark on delicious.com. It works just like the delicious Firefox extension works. What’s nice about all of these bookmarklets is that they work in Firefox, Chrome, and in Opera… and Internet Exploerer.

I found another bookmarklet at 1bit.markwheeler.net this bookmarklet will add a tiny play button next to any links to mp3′s that are in a webpage. So if you go to 8bitpeoples.com and run into a list of mp3′s, you can click this bookmarklet and play buttons will load next to each mp3 link.

javascript:function%20loadScript(scriptURL)
{var%20scriptElem=document.createElement('script');
scriptElem.setAttribute('language','JavaScript');
scriptElem.setAttribute('src',scriptURL);document.body.appendChild(scriptElem);
}loadScript('http://1bit.markwheeler.net/bookmarklet.js');

Enjoy…

     Add A Comment

You must be logged in to post a comment.