All in One Bookmarklet with a reusable javascript function

This bookmarklet is not for meant to bookmark the post’s on other’s blogs into your bookmarks account but it is for other’s to bookmark your post into their bookmarks account. Doesn’t that sound pretty exciting !!

This bookmarklet has been designed in such a manner that it can used for any blog aggregator or a bookmarks account and I have made a javascript function which can be reused if you want a bookmarking site which is not yet supported in this bookmarklet. I have managed it to support for 20 bookmark accounts till now. These include del.icio.us, digg, reddit, furl, google bookmarks, yahoo! myWeb, spurl, blinklist, newsvine, netscape, technorati, simpy, netvouz, rawsugar, blinkbits, ma.gnolia, blogmarks, feedmelinks, wists and shadows.

Getting the bookmarklet:

Follow the same steps from here to get the bookmarklet. But while copying the text intothe bookmarklet copy it from here bookmarklet.txt

You are now ready to use the bookmarklet. The steps to use the bookmarklet remain the same as I had mentioned in my earlier post here.

Further enhancing the bookmarklet

You don’t have to worry if you want another bookmarking site to be included coz the javascript function is very simple to use. Here’s the function

function getLink(uri, arg1, arg2, badge, title){

var href = uri + arg1 + '=' + encodeURIComponent(location.href) + '&' + arg2 + '='+encodeURIComponent(document.title);

var link = '<a href=\'' + href + '\' title=\'' + title + '\'><img src=\'' + badge + '\' alt=\'' + title + '\'></a>';

return link;

}

Definitions of the arguments:

uri –
It’s not the URL of the site but actually a complete path alongwith the other required arguments besides the usual URL and TITLE which most of the bookmarking site (BMS) expects


arg1
– This argument carries the name of querystring parameter related to “URL” which the BMS expects because some site have different names like “add” in technorati

arg2 – This argument is for the name of the parameter corresponding to “TITLE” required by the BMS

badge – This argument is the path of the image or logo or badge of the BMS

title – This is text required by “alt” attribute of the anchor tag in case you want tooltip to be displayed on mouse hovering over the badge. You may leave it optional by specifying empty string in the function

Calling the function:

Call the function and pass all the arguments for the corresponding BMS like this

str = getLink('http://del.icio.us/post?',

'url', 'title',

'http://static.flickr.com/81/263675101_69160fa6ce_m.jpg',

'Del.icio.us');

and then include this script in the bookmarklet before the statement

void(prompt('copyThis',str));

And you are done by adding another site in the list. Simple isn’t it! I have tested the output which the bookmarklet generates in some of my posts, even in this post and I was successfully able to bookmark my own post in the BMS I have included. So make the readers of your blog more comfortable with this bookmarklet and attract more of them. Share and enjoy !!

Bookmark / Share this post:


Del.icio.us Digg It! Reddit! Add to Furl Add it to Google Bookmarks Add to Yahoo!MyWeb Add to Spurl Add to BlinkList Add to Newsvine Add it to Netscape for voting Add to Technorati Add to Simpy Add to NetVouz Add to RawSugar Add to BlinkBits Add to Magnolia Add to BlogMarks Add to FeedMeLinks Add to Wists Add to Shadows

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: