Filter Tweets by Language

I’ve been so bored not tinkering lately, when I saw the follow tweet today from @tsimonite, I just had to have a 5 minute play:

So here was my thought process:

– hmm, Google has a language detection API, so we can just pass the tweets through that and filter on language; it’s probably easiest for a proof of concept to just filter a person’s Twitter RSS feed…
– now where’s the API? Search for google language detection api and turn up Google AJAX Language API documentation.
– ah, buggrit, too much like hard work – I’m sure I built a a pipe round this before: search for language detection yahoo pipe… This’ll do nicely:

Paul Donnelly’s Language Detector Pipe:

(For reference, the call to the API is simply:
So not that hard at all! ;-)

Clone the pipe, and pop it into another pipe that accepts a Twitter RSS feed:

Hmm… that’s probably too hard for most people to use, expecting people to be able to find someone’s RSS twitter feed… so make it easy – create the feed URL from a Twitter username:

Here’s the pipe: English tweets only.

(Just by the by, it took considerably longer to write this post than it did from seeing the tweet to publishing the pipe…)

PS What would be really nice would be for a Twitter client, such as Tweetdeck, to offer its own plugin architecture/API, so I could create a little routine based on something like the above to provide a language filter for incoming tweets, maybe on a per column basis, as required (or not).

It would then be easy to wire in things like Tweetspeech, which speaks your tweets out aloud, or a simple tweet translator:

Then of course there are all the geo related plugins you could do, such as a simple Tweetmap, or feed annotation services like serendipitwitterous or serendipitwitternews.

Author: Tony Hirst

I'm a Senior Lecturer at The Open University, with an interest in #opendata policy and practice, as well as general web tinkering...

5 thoughts on “Filter Tweets by Language”

  1. Thanks for introducing Yahoo’s Pipes. I had never heard of them. And now I see there are all sorted of variants (e.g. Google’s Mashup and AlchemyPoint). So cheers.

Comments are closed.

%d bloggers like this: