Update: Download link has been updated with a new Bing version. The Yahoo search API was sunset recently and the original service fails to work now. The new download will work for the time being…

I’ve had this one laying around for a long time, so I thought I’d toss it out on the ‘net and see if anyone else had a use for it. It’s actually really handy, and a big timesaver. It takes selected text and uses the Yahoo API to run a quick search for that term, and returns the result as a Markdown link. You can, of course, modify the output to any text-based markup (Rich Text links are a pain).

There’s a quick video of it in action in the full post, plus some extra info and a download link…

The Service is called “First Yahoo Link,” and does exactly that. In the video below, I just wrote out some random words that were pretty sure to have predictable search results. The more vague the search terms, the more unpredictable the result, obviously. I’m running the Service with the shortcut CTRL-SHIFT-Y, which I set in the Keyboard pane of the System Preferences. Here goes:

The majority of the code is a Yahoo API wrapper for Ruby by Premshree Pillai. I just shoved it into my Run Shell Script action in the Automator Workflow and built off of it. It just escapes your selected text, passes it to a Web search and then formats the first result in the returned array. There’s probably a lot more you could do with it, but I like its simplicity and relative speed. It’s definitely faster than flipping over to a browser, running a search and copying a link, coming back and pasting/formatting it manually.

Give it a shot, you never know, you just might like it.

Oh, and in case you haven’t been through this drill before, unzip the file, put the resulting workflow file in ~/Library/Services and then go into System Preferences > Keyboard > Keyboard Shortcuts and add a shortcut key for the “First Yahoo Link” service you should now have in there. Then just select text and hit your shortcut key (or pull it down in the Application > Services menu). Done.

Auto-link Web Search v2

A Snow Leopard Service that takes selected text, runs a Bing search for it and returns the first result as a Markdown link around the original text.

Published 08/27/11.

Updated 08/27/11. Changelog

DonateMore info…