Ever wanted to only show certain Twitter messages on your website? Hate all those geeky ones turning up on your personal site?
- Only includes tweets with the specified #tag included in them.
- Automatically links any @replies and web addresses.
- Reads from a Yahoo Pipe I’ve set up - so it’s fast, and cached.
- I tried to make a dynamically generated script (similar to how Google Analytics works) which would avoid having to enter your variables into the Yahoo Pipes URI yourself, but there is a JSONP parsing bug. So I dunno.
You can view my script here: http://lab.bandit.co.nz/scripts/selectivetwitter/bandit-selective-twitter.js
How to install:
Simply set up your code as follows.
Put this ul element somewhere in your code where you want your Tweet(s) to turn up:
With this code at the bottom of your page, before your
Note the above highlighted variables - you’ll need to replace these with your own. The first one is how many of your tweets you want to display (
&count=1), the second one is your hashtag that you want to filter by (
&hashtag=%23fb - %23 is equivalent of # - so %23fb is #fb), and the final one is your Twitter username (
By default the script strips out all #hashtags - if you want to only strip out your specified hashtag, include the following before the Yahoo Pipes (second) script tag above:
You can see it in use to the right. Hopefully this is helpful for someone!
This script is also covered here.