Latest twitter status hack

I was jobless, and as the saying goes “An idle mind is a devil’s workshop”, i thought i would do some arbit cool makeup for my blog. Now, what could i possibly put in so that my blog is a little more entertaining? Hmmm.. Twitter came to my mind without further delay. The previous twitter widget which i was having was a little too boring! Notice my twitter shouts at the top of the page?? Now that i have made the hack (i like to call it a “hack” cuz its kool.. though its not technically a “hack”) i thought i would give the code here so that anyone can use it 🙂

It uses this javascript : twitterhack.js

Another javascript hosted on twitter should also be included (TwitterCall)

The final code looks like :

Here, first half of the code is the layout of the twitter status (position on webpage, styling the div, twitter mascot image, etc). The second half is the code for including the javascript. Here the second line consists of a count param. You can specify the number of latest twits to be displayed.

You must include the above code in the header.php file if your are using WordPress. I have also optimised the code by placing the layout code in the header.php and the script inclusion code in the footer.php. This makes your page to appear quickly even if twitter takes a long time to respond.
So, it might come handy if twitter is down.

BUT CAUTION! Don’t forget to replace my twitter username a4arvind in a4arvind.json with yours (Example : twitter_user.json). Or else my twits will be displayed. LOL!

Though this is not a very big hack, it may help someone, somewhere. I hav done my part. Its now Google’s job to do the rest! 😛

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: