Get Twitter on Google Talk!

September 6, 2009

When Twitter had integration with IM, the IM was the only way I used Twitter.  First, the IM  (I use Google Talk) is always running on my computer. And then, logging on to Twitter to post a message and check statuses is such a pain.

I have been itching to get Twitter on my IM and was  porting my twitter friends statuses into  Friendfeed and pushing them to the IM as a workaround.

But since Google App Engine has now brought XMPP to its platform, writing a custom Twitter port on IM couldn’t be easier.

http://twitteresque.appspot.com/ is my application written on Python which brings Twitter to your Google Talk IM.

I used OAuth for the app to get access to Twitter and then a cron job to routinely check messages every hour and post to Twitter. Right now, you can post messages by typing into the chat window directly and fetch records manually by just typing in ‘fetch’.

Getting OAuth working from App Engine was a breeze thanks to these examples given here:

http://apiwiki.twitter.com/OAuth-Examples Especially, http://github.com/tav/tweetapp/tree/master

Solve sudoku puzzles on the cloud

January 5, 2009

I had written a Sudoku puzzle solver in Java some time back. Had some time today and rewrote it in Python so I could deploy it on GAE. The result is Sudoku Ninja.

It can currently solve most of the Hard problems on Web Sudoku.

It also has an API where you can enter the puzzle data as a series of numbers row by row and have ‘0’ in place of unfilled cells and send it as a GET request This returns text with the values filled in accordingly. Example.

Yet another feed aggregator…

December 6, 2008

I like the view of alltop.com because it allows you to scan the feeds very quickly. But I wanted a customizable selection of feeds and so set about writing http://feedsrus.appspot.com/ on Google App Engine.

Thanks to URL Fetch API in google app engine and the Feed Parser library it was really easy to build.

The feed entries are cached in memcache in GAE and refreshed every 30 mins. Because of some limits in the number of cycles a request can use, the current implementation doesn’t scale for more than 9 feeds or so. Planning to fetch 9 at a time and use AJAX to load the rest in bits.

UPDATE: I modified the code to use Google AJAX Feed API and removed the part in the server code where I download the feeds. This means that all the GAE needs to do is maintain the user’s feeds in the data store. And of course, it is fast now.

UPDATE 2:  Feedsrus now has tabs!

feedsrus_ss

Jabber Chat Bot Dictionary Service

September 23, 2008

Ever since I wrote this, I wanted an chat bot which would respond to messages and provide some service. One of my most desired service was to fetch word definitions. An avid user of Google’s define keyword search, I wanted it on a chat window.

Got some free time today and whipped up a dictionary service. With free libraries like xmpppy, pywordnet etc, writing the service was very easy.

Steps:

  1. Created a GMail Id to use as a Jabber Id
  2. Install xmppy and python-jabberbot which is a wrapper over xmpppy which makes it very easy to plug into a Jabber service
  3. Install WordNet for dictionary database
  4. Install PyWordNet which is a python interface for WordNet database
  5. Implement a method starting with bot_ e.g.  ‘bot_define’ so that when the user runs enters ‘define <word>, this method would be invoked and the meanings returned. See python-jabberbot link for more info.

Planning to extend this to put in more services.

Checking out Google App Engine

May 2, 2008

I finally sat down to play around with Google’s App Engine a couple of days back and the first thing that strikes you is how easy it is!

Taking the idea from Swaroop CH’s Productive Home Page, I wrote a small Start Page app where you can configure your favorite links for easy access. It hardly took an hour to write the code itself and the most time consuming part was getting an App name (“istartpage” in my case) because the good app names were already taken!

 

istartpage_ss

The SDK is very easy to work with and even simulates a login interface if you plan to use the Google Accounts sign-on for your app. But I found the template engine a little difficult to use. Rather than using built-in tags, why not allow just plain Python code in a template like it is in JSP‘s in Java .

App Engine provides a dashboard for your app where you can view/filter logs, view/delete table data etc.

All in all, a good platform to create hobby apps.

Instant messenger and the power of command line interface

April 29, 2008

The Instant Messenger is one of the most underrated applications of the internet.

IMs over time have become more powerful with more and more features like  Voice communication and File transfer. But one of the most recent applications of IM is Twitter which is fast becoming a new way to communicate.

What makes the IM very powerful?

1. It is textual — no fancy images or UI garbage

2. It is both Push *and* Pull — Push makes it ideal for receiving event updates like the way Twitter does

3. It is non intrusive

All these combined with a command line like interface make IM a very good way to access applications via an IRC bot.

For e.g. to send a direct message on twitter to a person, you send the following to Twitter

“d <name> <message>”

I cannot help but think that this is going to give way to much more powerful applications of an IM bot:

1. Search the web and get answers for stock quotes, news events, dictionary, weather etc.

2. Event aggregation for sites like FriendFeed, Facebook, Remember the milk etc. I found a service called  IMified which seems to be doing this already.

3. Access file systems on  a remote machine. Using DOS/Unix like commands, a  user should be able to access a file system and download files using File Transfer on IM.  With Microsoft announcing Mesh framework, this feature doesn’t seem too far from the future

4. Custom apps: A user might be able to define a custom app to ping her the names of friends from her social network who are celebrating their birthdays on this day. Or maybe an alert on the IM if a stock falls or rises beyond a point. Business applications like Salesforce.com etc can obviously add this to their service portfolio.

I am sure that a whole host of web services can be brought to the IM, but the question is how are you going to make money on the Instant Messenger?

Such a service can gather a LOT of information about the user over time and this makes way for targeted ads. And if it proves to be very useful, it can always be a paid service.

Get scores of Indian cricket matches on twitter

March 29, 2008

I wrote a script to fetch the scores from CricInfo‘s Live RSS feed and post messages to Twitter everytime the score changes.

You can get scores by following indiablues on Twitter.

The code is available here .

UPDATE: Inspired by baggygreen and meninblue, I wrote another script to scrape the comments of off CricInfo’s famous ball-by-ball commentary using BeautifulSoup and post it to Twitter using their API. The only difference is that, I post only the comments mentioning boundaries or Sixes or Outs. Getting all commentary is boring. Anyways, the code is available here.

Showing white space ‘as-is’ in HTML

March 14, 2008

A common gripe about HTML rendering is that white spaces are not preserved.

For e.g. giving

<table><tr><td>This is       a                       test</td></tr></table>

will end up being shown as ‘This is a test’.

To show the spaces, people generally convert spaces to & nbsp;

to preserve the spaces. Instead, a CSS property ‘white-space’ can be used.

For e.g. to preserve the spaces, do this:

<table><tr><td style = "white-space:PRE">This is       a                       test</td></tr></table>

This will display preserve the white spaces and show

'This is            a                        test'

on the browser. We need to include a !DOCTYPE to make use of ‘white-space:pre’ property on IE.

FriendFeed Custom Button for Google Toolbar

February 4, 2008

I wrote a Custom Button for FriendFeed since it is becoming my new hangout place on the net 🙂

Here is the link: http://vishalmanohar.googlepages.com/friendfeed.xml

Paste the file in C:\Documents and Settings\<your-folder>\Local Settings\Application Data\Google\Custom Buttons  and restart your browser on which the Toolbar is installed. It will show the button.

Twittering away

January 18, 2008

I failed to see the light in the beginning. Twitter which was basically introduced as a micro-blogging idea on the question of ‘What are you doing now?’ seemed pretty lame and not-very-useful to me.

But over time people have come up with finding the right applications of Twitter.

1. Twitter as a broadcast service. For emergency updates like California fires etc. Twitter is probably the fastest medium of information exchange.

2. Live News, stock quotes, sports scores. http://twitter.com/baggygreen has been my way to know the latest scores the recent India v/s Australia test series

3. Apps like Buxfer, Remember the milk etc are using Twitter’s direct message functionality for simulating a command line interface to access the apps.

4. This blog details out how famous blogger Robert Scoble used Twitter to bring a press conference right in front of his audience. Journalism taken to a whole new level.

5. Ask for help. Have a problem with your PC or any app? Twitter away to get instant help.

Wishlists?

1. I wish I could group people using tags/labels and send messages to a specific group say family, friends, etc..

2. Google should be on twitter too. I would then be able to query latest stock quotes/scores. But I guess they won’t do this since you can’t show Ads on a 140 char limit tweet 🙂