Friday, October 1, 2010

YouTube Mobile Search Bookmarklet

As an iPhone owner, I was happy to hear about the upgrades to the YouTube Mobile site. It brought a bunch of new features of YouTube to the mobile space. Unfortunately, no plans were announced to update the native iPhone app.

After navigating to the site a few dozen times and then doing whatever search I wanted to do, I finally decided it was time for another bookmarklet. This one is essentially a tweak on the Beer Advocate Search I posted about previously.

You can drag the YouTube Mobile Search to your browser toolbar if you want to use it on the desktop (not really sure why you'd want to, but hey, you can do it). In your iPhone, you'll have to add a bookmark and then manually edit and copy in the following code:

javascript:q=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!q)q=prompt(%22Search%20YouTube%20Mobile%22).replace(/%5Cs%5C+/g,%22%252B%22);if(q!=null)window.open(%22http://m.youtube.com/#/results?q=%22+q.replace(/%5Cs+/g,%22+%22));void(0);