Kilian Valkhof

Front-end & user experience developer, Jedi.

Twitter search in sidebar using Greasemonkey

Javascript, 6 October 2008

Twitter’s recent redesign is great, but quite a few people missed the Twitter people search, or hoped it would add the new search.twitter.com in the sidebar. As I hadn’t done anything with Greasemonkey yet, but wanted to play around with it for some time, I decided to combine the two.

Twitter search in sidebar

Click the link to install it using Greasemonkey: twittersearch.user.js

And this is what it looks like:
screenshot by Robert Gaal

Greasemonkey

There is one awesome thing about doing stuff with Greasemonkey: it’s easy. You’re just writing regular javascript and some comments that tell Greasemonkey the name and description, which websites to apply to (or not to apply to) and that’s it. The above script took me about an hour, including eating my dinner.

If you need to do heavier stuff and want to make use of library’s, you can do that, too. The only gotcha I really had, had to do with innerHTML (shock!) that acted a bit icky with onfocus functions and parameters in quotes. Solution: remove the quotes.

Onfocus? Not event listeners? Well, no. Greasemonkey script themselves are javascript already, so if it’s in the page, then the user has javascript on. Using an onfocus then is just much easier :)

There are a couple of websites I looked around to find info on Greasemonkey:

If there’s an annoyance with a website you use often, and you think you could fix it easily, then Greasemonkey is an excellent way to do that fast and easy. Do you have any tips for Greasemonkey?

Thanks for Reading!

I am Kilian Valkhof, a front-end and user experience developer from the Netherlands.
Contact me or ping me on twitter.

  1. Roy Tomeij

    Thanks for the script :)

    I’m doing one soon to fix my #1 annoyance with Rabobank Internetbankieren: you can’t submit a form by pressing . To be fixed the Greasemonkey way.

    I played around with GM for the first time last week and wrote an unfinished script that, when on your Twitter page, requests your friendstatus feed every n seconds using AJAX. When there’s something new it adds the new status to the timeline. Quite happy to use jQuery with that :)

  2. Roy Tomeij

    Sorry, didn’t escape the tag, should be “you can’t submit a form by pressing <enter>.”

Be the first to know about new releases!

Newsletter subscribers will be the first to know about new apps I release or new articles I write, here or elsewhere.

Low-volume. I will only email you when I have something exciting to share.