Ever wanted to only show certain Twitter messages on your website? Hate all those geeky ones turning up on your personal site?
Then use my Javascript badge to pick out your latest tweet(s) featuring a specified hashtag (ie: #fb) using a Yahoo Pipe I've set up.
You can view my script here: http://lab.bandit.co.nz/scripts/selectivetwitter/bandit-selective-twitter.js
Simply set up your code as follows.
Put this ul element somewhere in your code where you want your Tweet(s) to turn up:
<ul id="twitter_update_list"></ul>
With this code at the bottom of your page, before your </body>
tag:
<script type="text/javascript" src="http://lab.bandit.co.nz/scripts/selectivetwitter/bandit-selective-twitter.js"></script> <script type="text/javascript" src="http://pipes.yahoo.com/pipes/pipe.run?_id=qjafMhoS3hGdTjn51ZzWFw&_render=json&count=1&hashtag=%23fb&username=Bandit&_callback=bd_twitter_cb"></script>
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 (&username=Bandit
).
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:
<script type="text/javascript">hashtag="fb";</script>
Hopefully this is helpful for someone. It was made with love by James Nisbet - the resident webmantis at Bandit Design.