These days, you might have noticed that many blogs have a Twitter widget added along the sidebar with their latest tweets. Well that’s no big deal as you can easily get a widget from Twitter’s site. Or there are other third party tools that make it easier for you to show a Twitter widget on your blog. Do you know that you can also make your custom Twitter widget with Google Spreadsheets? This is very easy to do and you can fully customize the colors, number of tweets to show etc.
To begin creating a twitter widget using Google Spreadsheets, you’ll first need the RSS feed URL of your Twitter updates. Open up your Twitter page(in my case it is http://twitter.com/Techattitude) and click on the RSS feed link located at the right hand panel. Copy its URL.
Now open a new Spreadsheets in Google Docs. What you’ll actually do is pull the RSS feed of your Twitter Updates in Google Docs. Now click on the first cell of the Spreadsheet. Here you’ll need the RSS feed URL of your Twitter Updates that you copied previously. Now insert the following function into the first cell:
=importFeed(“http://twitter.com/statuses/user_timeline/16732563.rss”, “items title”, FALSE, 10)
Replace the RSS feed URL(http://twitter.com/statuses/user_timeline/16732563.rss) with yours. The “items title” pulls just your updates excluding other details. You are just creating a simple Twitter widget in Google Spreadsheets; so I assume you won’t need other details like date, actual URL of the update etc. “FALSE” is added to hide the headers. And the number(here 10) pertains to the number of items to be shown. You can change this to any number you like. I also recommend you to change the name of the Sheet to your Twitter username as it will show up in the Twitter Widget.
After you insert this function in the first cell in Google Spreadsheets, you’ll see your Twitter updates in the first column. If you want to make your widget colorful, you can also change the font and background colors. You can try something simple like changing the background color of every other cell. Just select the required cell and change their colors from the toolbar.
You can also adjust the width of the first column of your spreadsheet by dragging it towards the right. It would be better if the column width is the same as your blog’s sidebar where you’ll be inserting the widget. Google Spreadsheets doesn’t let you enter the column width in number. So if you want to have a precise width, download JRuler. Now go ahead and save your spreadsheet.
This Google spreadsheet will act as the Twitter widget for your blog or website. So first you’ll need to publish it. To publish, click on Share>Publish as a webpage. Now you’ll see a handful of options. Under “Sheets to publish”, select just the Sheet you were working on from the dropdown. Click on Start Publishing. After this, other options for publishing will get activated. Here, choose “HTML to embed in a webpage” from the drop down. If you choose to show just 10 items enter A1:A10 instead of All Cells. Finally copy the code generated. The code will look something like this:
In the above code, replace the width with the width of your sidebar. You can change the height as per your requirement. If the height is less, a scrollbar will appear alongside the widget. After you’re done editing the code, paste it as a sidebar widget in your blog. Now refresh your blog and you’ll see the smart Twitter widget created with Google Spreadsheets.