Sunday, October 3, 2010

[How to] Filter out tweets on New Twitter interface

Twitter has been rolling out the preview version of its new interface and I got the chance to try it out just few days back. One of the basic functionalities which is missing even in the new interface is the ability to filter out tweets. Twitter is a nice medium for catching up on the latest happenings. But, at times, you might get bombarded with tweets (all of which carrying the  same message) about the same topic from different people and might have to miss some important ones. Filtering is a must-to-have feature in an application like Twitter but Twitter is yet to realize the need for it. However, this feature is already available on some of the popular Twitter clients like Tweetdeck. I have written a simple GreaseMonkey script to add this functionality to New Twitter.

Twitter menu showing 'Filters'. 22 tweets have been filtered out.

Filter options

Filters menu on TwitterFeatures

  • Filter out a person. If a person on your timeline is on a spamming spree, you can temporarily unfollow him / her using this feature. Typical example for this could be a person attending a conference / tech talk and live tweeting from there. His / her tweets might not be applicable outside the conference room. You can use this feature to temporarily unfollow the person.
  • Filter out keywords. Filter out tweets containing a set of words. You can enter multiple words separated by a comma. This will prevent your timeline getting flooded with the trending topics.
  • Remove hyperlinks. In the past few weeks alone, there were two different cases of XSS attack on Twitter. This feature will safeguard you from these sort of attacks to some extent by removing all the external links from your timeline.
  • Filtered count Indicator. The filtered tweets are not gone for ever. You can clear the filters to view them. The number of tweets filtered out will be shown intuitively on the ‘Filters’ menu itself.
  • Remember your settings. The script has the ability to remember your filter settings on the browser and will reload the same when you sign in again. Also, the script applies the filters on new incoming tweets as well (with a max time lag of 15 secs).

How to install?

Compatible Browsers: Firefox 3+, Chrome 4+

Firefox 3+

  • Install the GreaseMonkey add-on for Firefox from here and restart the browser.
  • Get the script by pointing your browser to this.
  • GreaseMonkey Installation dialog box will appear. Please click on the “Install” button.
  • You are all set to use the script. Refresh the twitter homepage. ‘Filters’ menu will appear next to ‘Messages’ menu.

Chrome 4+

  • Chrome has native support for GreaseMonkey scripts. No additional extensions are needed to use the script.
  • Get the script by pointing your browser to this.
  • You will be prompted with a security alert. Please click on the ‘Continue’ button.
  • The script will be installed as an extension. Refresh the twitter homepage to see the ‘Filters’ menu.

The script might contain few minor UI glitches. Please let me know if you find any. If you feel some other feature is missing in Twitter, please reach out to me. I shall try to extend this script. If you are still on old Twitter and looking forward to one such script, try this script. If you are looking for a similar script for Facebook updates, try this script.

Userscripts.org seems to go down frequently these days. Here is an alternate link to the script. Source code is available here

-- Varun

12 comments:

  1. The filter button became unclickable yesterday under FF3 and FF4b6 ...
    Can you fix that or maybe it's my problem?

    ReplyDelete
  2. The page might not have loaded fully. Try refreshing the page.

    -- Varun

    ReplyDelete
  3. not working for me. :-(

    Chrome latest build. refreshed the page again. didnt work. :-(

    ReplyDelete
  4. @Senthil: It was due to some changes in Twitter UI. Fixed the same. Try again.

    ReplyDelete
  5. Doesn't work for me, the apply button won't click on Chrome, neither the filtering. Great idea though, it's amazing!

    ReplyDelete
  6. Hernan, its working fine for me. Which browser are you using??

    ReplyDelete
  7. Thank you! Very useful. Can I disable the counter?

    ReplyDelete
  8. Hi Varun.

    Your script is wonderful, but for some reason it has stopped working on my laptop. I'm using FF 8.0 on Macbook Pro.

    ReplyDelete
  9. Hi Andrew,

    I have made the necessary fixes. Check out the latest code from here -- https://github.com/varunkumar/filter-twitter/raw/master/filter_tweets.user.js

    Thanks,
    Varun

    ReplyDelete
  10. I like the fb filter more. I think having a timeout for each filter will be a good feature to have. Like CWG or Ayodhya will only be a trend for a time. So say filter for 1week or 1 month makes sense and then the filter gets auto disabled.

    Thoughts?

    ReplyDelete
  11. Best filter script for twitter! Thanks!

    ReplyDelete