April 5, 2011, 5:19 p.m.
posted by neverloop
Add a Yahoo! Bookmark with One Click
Yahoo! Bookmarks are an easy way to share a list of web sites across several computers. If you have a set of sites you like to visit from home, the office, a friend's house, or any other place you might find yourself in front of a computer, they'll always be just a few clicks away at your Yahoo! account, instead of trapped inside your browser at home.
Unfortunately, setting up this list of sites for the first time can be time-consuming. After logging into My Yahoo!, you must find your bookmarks (usually in the upper-right corner); click Add; copy and paste the site URL, name, and any comments into the form; and click the Save button. This might not sound too labor intensive, but it amounts to quite a few steps if you're adding more than a few sites.
The Magic of Bookmarklets
Take a look at the bold querystring variables in the code. These are the primary elements of the Yahoo! URL we're concerned with. Here's a quick look at what each variable represents:
The URL to display after the action is completed.
The ID of the folder in which you'd like the bookmark to be included. If you don't have multiple folders, use 1, which is the default.
The name of the site you're adding as a bookmark.
Some arbitrary text that is associated with the bookmark.
Unfortunately, a bookmarklet is no place for readable code with comments and line breaks. Instead, the code needs to be smashed into its most compact form. Here's a look at the code reformatted for use in a bookmarklet:
Running the Hack
Once the bookmark is in place, browse to any page, highlight some text on the page, and click away! Once you click, a new window will let you know the bookmark has been added to your list, as shown in Figure.
The Add Y!Bookmark bookmarklet in the browser toolbar
The new bookmark added to Yahoo! Bookmarks
The best part of keeping your bookmarks at Yahoo! is that the next time people are gathered around someone else's laptop trying to remember the location of some cool site you visited last week, you can save the day by saying, "I have that site bookmarked at Yahoo!"