Labs: Twitter Add-on (extension) for Google Chrome
Did you like this post, take a look at the new post and the new version of the add-on (extension): http://www.e-x-e.dk/2009/05/30/labs-twitter-add-on-extension-for-google-chrome-new-version-new-post/.
So, today I saw some article about the Google Chrome add-ons (extensions as they also call them). And since I’m a Chrome user myself I decided to play along by creating a small basic extension for Chrome.
I went along and created a small extension which would update a persons status on Twitter (and possibly also Facebook - through the Twitter application). It works in a really simple fashion using a client-part and a server-part. I had to do so since Google Chrome doesn’t support native cURL yet. So this is how it works:
Client-part: A simple form containing the status, username and password which is posting to a php file (post.php).
Server-part: The server-part consists of the post.php and the twitterAPI.php. The post.php handels the post from the client and calls the function (in twitterAPI.php) which does a cURL post to the Twitter API. The function returns a fresh form ready to update the status after entering the new status and the password (username has been passed on after the return). The twitterAPI.php is a modified edition of the original work of Antonio Lupetti (http://woork.blogspot.com/2007/10/twitter-send-message-from-php-page.html)
For testing I just used the commandline option by editing the shortcut:
Target:
"path_to_the_chrome.exe" --enable-extensions --load-extension="The_path_to_the_addon_folder"
fx.
"C:\Users\Thomas Stig Jacobsen\AppData\Local\Google\Chrome\Application\chrome.exe" --enable-extensions --load-extension="C:\Users\Thomas Stig Jacobsen\Documents\Chrome addons\twitter"
Start in:
"path_to_your_chrome_application_folder"
fx.
"C:\Users\Thomas Stig Jacobsen\AppData\Local\Google\Chrome\Application"
I’m allowing anyone to use my server as the server-part (there is no kind of logging, I’m using the files that you can download underneath).
All the files can be found here:
http://e-x-e.dk/labs/chrome-twitter/twitter-addon.zip
Screenshot:
Hey, just ran across this. Nice start.
Can you explain why you need to have the server part? I expected that you’d be able to POST directly from the extension to Twitter’s API, using XHR. What doesn’t work with this?
Also, I have an idea for the UI. What if you made it start out small (just the twitter icon) and then on mouseover or click, it animates larger so you can enter the status.
Hey Aaron.
Thank you for the kind words and the comment. When starting to write this extension I headed over to the Twitter API (http://apiwiki.twitter.com/) and saw the PHP possibilities.
Anyway, I’ll do a rewrite of the extension later today (GTM+1) and I’ll try to remove the server-layer and make a new UI as you suggested.
From there it alomst developed it self
Best Regards
Thomas