|
What we're listening to:
|
Filtering the Twitter WidgetOctober 6th, 2010While working on a product blog of ours, I wanted to display our recent tweets in the sidebar, but found that included a lot of extraneous @ replies that I didn’t want included in the stream. I’m not sure it’s documented anywhere, but the official twitter widget does allow you to pass a variable called filters to do this. Here’s how I implemented it: On line 2 is where I added my filtering function, in this case all tweets that start with @, which are replies. Line 34 is where I pass the filter function to the twitter widget. Negatives indicates to the twitter script that I want it to remove all tweets that my filter function returns true for. If you wanted to do the reverse, just change ‘negatives’ to ‘positives’ and in this case, it would only show the @ replies in the stream.
|