Monday, July 27, 2009

Moving away from www

Since I have been spending some time recently on hacking, I wanted to start using custom domains and also start using www.shreeni.info for other things and not just this blog. Hence I am moving away this blog from www.shreeni.info to blog.shreeni.info. Not that it makes much of a difference if you are using the feedburner link to subscribe to the blog or if you are coming to the blog from other places. That said, if you do come to the site directly or use a bookmark, make sure you update those.

Update: All blogs posts from 2003-2011 will continue to work with the previous page urls too (although it will redirect to blog.shreeni.info) - thanks to a quick and dirty hack - I will blog about it later.

Sunday, July 26, 2009

Tracking me on Twitter

For a while, I have been thinking of hacking up a system which would track up all the tweets that talk of me - just for the fun of it. So, I started using the Twitter API and built up an hack to scan through the public timeline and store those tweets and to publish it later in whatever way deemed fit. Turns out, that's not so easy - since this public timeline only lists 20 recent tweets every minute (off the thousands or hundreds of thousands that might be generated.)

The right way to do this would have been to use the twitter firehouse, which of course is not openly available to everybody, or to use the search interface. As I was planning to shift the code to use that, I hit upon this neat little widget from Twitter, which allows me to create a widget to track all the tweets containing my name and allows me to publish this wherever. I am putting this up on this blog. I have taken out the widget showing my tweets to the new widget titled "Chatter about me on twitverse" and its a dynamically updating widget. At this moment, I am enjoying the look of the new widget on my blog.

Update: I have removed the widget from this blog since I have made my twitter stream private. You can still get the widget from the link.

Sunday, July 19, 2009

The curious case of Rajshri and Incredible India

Ever since I moved to Singapore, I found that rajshri.com is a fantastic source of good Indian content legally available. The site is owned by the Rajshri group, the reputed Indian media house, which gave us hits like Hum Aapke Hain Kaun and Maine Pyaar Kiya. The site doesn't have anything cutting edge (new movies etc), but still has a lot of good older movies and lots of TV series content. Its quite appealing and while the user experience is not excellent, the streaming is pretty good. All in all, a good site to visit on a regular basis.

There are a bunch of technical problems - don't ever try going back or forward in the video, you will be stuck forever; or every once in a while, the streaming itself will completely freeze (and if it happens towards the end of a movie, you will miss the ending since the rewind and FF doesn't work), but this blog is about something else that I find grossly wrong about that site.

I understand that the site has to make money (at least for the cost of hosting and serving the content) and ads seem the best way. Being an Non Resident Indian (NRI), some of the ads presented to me makes sense - like those of banks advertising NRI products. But the most common ad you see on the site is that of Incredible India.

Right, I understand that the Incredible India ads should be served outside of India, but do you really want it to be shown to NRIs? NRIs, by themselves, have enough reasons (family bonds) to visit India every once in a while and if they don't want to visit India for that reason, I doubt they want to do it on the insistent claim of the Indian Ministry of Tourism.

The only reason it makes sense is if the content was seen by Foreigners - the Singaporeans, Malaysians and the like, who might actually make good tourists. But will they be visiting rajshri.com and checking out Hindi TV Series, or Mahabharat, or Hum Aapke Hain Kaun? I very much doubt so. I am yet to hear of a single Singaporean who sees any Indian Content. I have heard of the Bollywood craze in Malaysia and Thailand, but here in Singapore, there is no craze.

I am guessing that either the Incredible India guys have got it all wrong when they decided to serve ads on that site, or it is a case of collusion between an Indian Govt organization and a private one to move money in a particular direction (and you know which one I am talking about). I quite often imagine a guy from the Indian Ministry of Tourism (which runs the Incredible India campaign) receiving a neat kickback in exchange for channeling the Government's (in turn tax payers') money to run rajshri.com's bill and potentially give them a healthy profit to boot.

Whatever the reason, I don't like the idea of two organizations of high repute getting it either wrong or voluntarily doing it wrong.

ps: This blog is based on ads seen here in Singapore and the experience of visitors from some other region might be quite different.

Saturday, July 4, 2009

[Hack]: Rahu Kalam Calculator

Rahu Kalam, in Indian Astrology, is considered that part of the day which is inauspicious for starting new activities or performing good deeds. More on how to calculate Rahu Kalam at Wikipiedia. Essentially, Rahu Kalam is supposed to be calculated on the basis on the sunrise and sunset times, which in turns depends on where you live. Calculating this is quite tedious.

In India, since it is mostly South Indians who believe in Rahu Kalam, they tend to assume that sunrise and sunset is 0600 and 1800 Hrs respectively. This leads to fixed times of the Rahu Kalam on each day of the week. This, however, could be wrong depending on the seasons. Even more importantly, this would be quite wrong in others parts of the world. In Singapore, sunrise is rarely before 7.00 AM and in Scandinavian counties, sunrise and sunset hugely varies depending on the season. So, I decided to write a hack to automate all this.

So the site is at:
http://rahukalamcalculator.appspot.com/

Essentially, you need to tell where you are from (Bangalore, Hyderabad, New York etc) and based on the lat-long on that location, it will calculate the Sunrise Sunset times and tell you the Rahu Kalam for the next 3 days. You are of course free to choose a specific date and find the Rahu Kalam for that date. The system will remember your location choice and not ask you next time. (You can choose to clear it, of course)

The hack itself involves using a bunch of webservices - the Yahoo Maps Webservice for geocoding a location and getting its latitude and longitude. Second, I used the Earthtools API to get the sunrise and the sunset of a given location. Everything else is calculated internally. I have hosted it on Google App Engine.

Please test the tool and give me your much-sought-after feedback/suggestions etc. You may also tell me what you want to see there.

I will clean up the code in a while and post it in public.