Blog2009 ≫ twfeed.js - twitter feed javascript badge / widget you can use for free

a badge / widget type thing for #twitter, what I wrote

Get it here1, a simple js feed thing that I wrote for my blog and am spreading round a few other places. Look out non techie / web page owning readers, example code coming up, you might as well turn away now...

I know there are billions of these out there, but writing my own is partly a way of trying out the search api2, and partly my way of saying "I'm here, I'm into twitter now!". This has some bits of twitter's original blogger widget3, but has some extra functionality that I wanted.

Requires jquery4, but after that is quite small. Grabs a feed of your choice from twitter, a search for something you're interested in, or mentions of your name or your @replies, and updates on the page of your choice. To use, include the js on your page, like so

<script src="http://www.clarkeology.com/js/twfeed.js"></script>
<ul class="tw"></ul>

Then optionally, if you want to choose your own feed / search terms, instead of just choosing my default, add a link to your feed somewhere like

<link rel="tw" href="http://search.twitter.com/search.json?q=@pauly" />

or

my feed5

Only rel="tw" and the href are the important bits there. And you're ready to go!

Still tweaking it and things, but any feedback appreciated. You can see it in action in the right hand sidebar of my blog ... twitter me, @pauly, and you'll appear there (without needing to refresh the page).

js: Programming language of the internets, mostly how I make my living.

⬅️ :: ➡️

Paul Clarke's weblog - I live in A small town. Wed and dad to 2, I'm a full-stack web developr, + I do js / nodejs, some ruby, python, php etc. I like pubbing, parkrun, eating, home-automation and other diy jiggery-pokery, history, genealogy, TV, squirrels, pirates, lego, + TIME TRAVEL.