Web lookup using Google Spreadsheets

I’d written earlier about Web lookup in Excel. I showed an example how you could create a movie wishlist that showed the links to the torrents from Mininova. You can do that even easier on Google Spreadsheets. It has 4 functions that let you import external data: =importData(“URL of CSV or TSV file”). Imports a comma-separated or tab-separated file. =importFeed(URL).vLets you import any Atom or RSS feed. =importHtml(URL, “list” | “table”, index). Imports a table or list from any web page. =importXML(“URL”,“query”). Imports anything from any web page using XPath. Firstly, you can see straight off why it’s easy to view RSS feeds in Google Spreadsheets. Just use the importFeed function straight away. So, for example, if I wanted to track all 8GB iPods on Google Base, I can import its feed in Google Spreadsheets. ...

Taare Zameen Par and Calvin

Watch this segment of Taare Zameen Par. Then check these Calvin & Hobbes strips. ...

Tamil songs quiz - Enchanting first interludes

Some background scores just stay in your mind. Here is a tribute to 20 wonderful first interludes, dating from the 1980s to the 2000s. Can you guess which movies they are from? (My intention here is not to make this tough, but rather to let you enjoy the music. So hope to see most of you score 20/20) Don't worry about the spelling. Just spell it like it sounds, and the box will turn green. ...

Javascript error logging

If something goes wrong with my site, I like to know of it. My top three problems are: The site is down A page is missing Javascript isn’t working This is the last of 3 articles on these topics. I am a bad programmer I am not a professional developer. In fact, I’m not a developer at all. I’m a management consultant. (Usually, it’s myself I’m trying to convince.) Since no one pays me for what little code I write, no one shouts at me for getting it wrong. So I have a happy and sloppy coding style. I write what I feel like, and publish it. I don’t test it. Worse, sometimes, I don’t even run it once. I’ve sent little scripts off to people which wouldn’t even compile. I make changes to this site at midnight, upload it, and go off to sleep without checking if the change has crashed the site or not. But no one tells me so At work, that’s usually OK. On the few occasions where I’ve written Perl scripts or VB Macros that don’t work, people call me back within a few hours, very worried that THEY’d done something wrong. (Sometimes, I don’t contradict them.) It can be quite a stressful experience but good thing you can learn more here on how to cope up with it. On my site, I don’t always get that kind of feedback. People just click the back button and go elsewhere. Recently, I’ve been doing more Javascript work on my site than writing stuff. Usually, the code works for me. (I write it for myself in the first place.) But I end up optimising for Firefox rather than IE, and for the plugins I have, etc. When I try the same app a few months later on my media PC, it doesn’t work, and shockingly enough, no one’s bothered telling me about it all these months. They’d just click, nothing happens, they’d vanish. But their browsers can tell me The good part about writing code in Javascript is that I can catch exceptions. Any Javascript error can be trapped. So since the end of last year, I’ve started wrapping almost every Javascript function I write in a try {} catch() {} block. In the catch block, I send a log message reporting the error. The code looks something like this: ...

Monitoring site downtime

If something goes wrong with my site, I like to know of it. My top three problems are: The site is down A page is missing Javascript isn’t working I’ll talk about how I manage these over 3 articles. My site used to go down a lot. Initially that was because I kept playing around with mod_rewrite and other Apache modules without quite understanding them. I’d make a change and upload it without testing. (I’m like that.) And then I’d go to sleep. ...

Handling missing pages

If something goes wrong with my site, I like to know of it. My top three problems are: The site is down A page is missing Javascript isn’t working This article covers the second topic. One thing I’m curious about is hits to non-existent pages (404s) on my site. I usually get 404s because: I renamed the page Someone typed a wrong URL Someone followed a wrong link Find the 404 ...

Managing feed overload

I have only two problems with Google Reader. The first is that it doesn’t support authenticated feeds. Ideally, I’d have liked to have a single reading list that combines my e-mail with newsfeeds. GMail offers RSS feeds of your e-mail. But the feeds require authentication (obviously) and Google Reader doesn’t support that right now. (So I usually don’t read e-mail :-) The second is that it’s tough to manage large feeds. It’s a personal quirk, really. I like to read all entries. If there are 100, I read all 100. If there are 1000, I struggle but read all 1000. I’m too scared to “Mark all read” because there are some sources that I don’t want to miss. ...

Scraping RSS feeds using XPath

If a site doesn't have an RSS feed, your simplest option is to use Page2Rss, which gives a feed of what's changed on a page. My needs, sometimes, are a bit more specific. For example, I want to track new movies on the IMDb Top 250. They don't offer a feed. I don't want to track all the other junk on that page. Just the top 250. There's a standard called XPath. It can be used to search in an HTML document in a pretty straightforward way. Here are some examples: ...

Advanced Google Reader

I’ve stopped visiting websites. No, really. There’s only one website I visit these days. Google Reader. Google Reader is a feed reader. If you want to just catch up on the new stuff on a site, you can add the site to Google Reader. Anything new that is published on the site appears in Google Reader. Right now, I’ve subscribed to over 50 feeds. There’s no way I can remember to visit 50 sites – so I’m actually able to read more and miss less. ...

Website load distribution using Javascript

My music search engine shows a list of songs as you type – sort of like Google’s autosuggest feature. I load my entire list of songs upfront for this to work. Though it’s compressed to load fast, each time you load the page, it downloads about 500KB worth of song titles. My allotted bandwidth on my hosting service is 3GB per month. To ensure I don’t exceed it, I uploaded the songs list to an alternate free server: Freehostia. This keeps my load down. If I exceed Freehostia’s limit, my main site won’t be affected – just the songs. I also uploaded half of them to Google Pages, to be safe. ...

A busy break from blogging

Between July 17th and August 22nd, I saw 57 movies and read 7 books. There were Saturdays when I watched four movies back-to-back. (I tried five. Couldn’t stay awake.) Amidst this, I also cooked, cleaned, shopped… and went to office. (Oh yes, I was working 10 hours a day.) And managed to build some interesting sites which I’ll release in a while. But first, let me share the books with you. ...

Default camera ISO setting

In those early days, when all I had was an analog SLR, I had to make choices up-front. Do I buy an ISO 100 film for daytime shooting? (It’s cheaper, besides.) Do I go in for the expensive ISO 1600 film for my fancy night shots? Do I lug around the tripod? Do I use the flash? Do I even bother taking indoor shots? etc. With my new digital camera, at least the ISO choice vanishes. The ISO range varies from 64 to 1600. And so, I don’t need flash or a tripod most of the time. ...

Tamil songs quiz 2006-2007

Here is the background music from some hit songs from 2006 and 2007. Can you guess which movie they are from? Don't worry about the spelling. Just spell it like it sounds, and the box will turn green. (A couple of spellings are tricky. Try J instead of S and V instead of G.) Comments Anonymous 8 Jun 2007 12:00 pm: Error in plugin! natarajan 8 Jun 2007 12:00 pm: Ur quizzes are great.great idea. but in this quiz, when we download we get all the details about the clip including movie name which is the album title. Thrill of finding the name is lost. Sanketh 8 Jun 2007 12:00 pm: Awesome quiz … couldn’’t figure out the answers to 3,5,6,10 … could you please post them some time. Or maybe I can just see the file names in the HTML :) Btw, glad someone else likes Atrai Thingal S Anand 8 Jun 2007 12:00 pm: Natarajan, you’’re right. I’’ve removed the clip details now. Thanks! ravishankar 8 Jun 2007 12:00 pm: all are easy clues..but where to fill in the answers??? Prin 8 Jun 2007 12:00 pm: Got 9! Couldn’’t figure out number 8 - haunting me tho’’. Awesome quiz and idea btw… Kumbakonam 8 Jun 2007 12:00 pm: I am the winner! I got 10! sirpi 8 Jun 2007 12:00 pm: can u plz give clues for 2 and 9 ragav 8 Jun 2007 12:00 pm: good quiz …cant find number 6 :( shud be yuvan song :D anees khanem 8 Jun 2007 12:00 pm: awesome Senthilkumar.S 24 Mar 2009 7:18 am: Nice one… got 10 out of 10… Niranjan 18 Mar 2009 12:50 pm: cannot find no 6…… 9 out of 10 correct vidhya 5 Aug 2009 8:13 am: I got only five.It’s very interesting.It’s nice to work. supraja and ranjith 2 Sep 2009 11:56 am: very intresting.i got only 7 out of 10.could not find 1,6,9…………………………. Priya 11 Apr 2010 9:58 am: Can someone please tell me no 1? im really going crazy….. Swathi 17 Jul 2012 1:51 am: what is the answer for number 10? ramya 16 Dec 2011 5:31 pm: ans: 6 pattiyal,8 kalvanin kadhali, 1 pachaikili muthucharam and 9 sivapathikaram fowziya 24 Dec 2011 10:54 am: what a great quiz man!!!!!! awesome! next time add songs of latest 2011!!!!!!! its a great time pass…………:-)xxxxxlove it Ranjani 7 Aug 2011 1:44 pm: 6/10 Kamala 25 Nov 2015 6:19 am: Great Quiz! Can you email me the answers please.

Making my music search engine faster

My music search engine takes quite a while to load (typically 40 seconds). That's an unusually long time for a page, given that most of the people that access it are on broadband connections, and are listening to music online. The reason is, firstly, that I'm loading a lot of data. Literally every single song on that you can search comes through as Javascript. All the downloadable Hindi songs, for instance, occupy 1.3 megabytes before compression. On average, this takes about 20 seconds to load. ...

Reducing the server load

I’m been using a shared hosting service with 100 WebSpace over the last 7 years. It’s an ad-free account that offers 100MB of space and 3GB of bandwidth per month. Things were fine until two months ago, which was when my song search engines started attracting an audience. I had anticipated that I might run out of bandwidth, so I used a different server (that has 5GB of bandwidth per month quota) for loading the songs. But what I didn’t anticipate whas that my server load would run over the allotted CPU limit. ...

Calvin and Hobbes animated

A Calvin and Hobbes cartoon, drawn by Dadomani. Comments kasi 28 May 2007 1:31 pm: Hi Anand, U must check this http://david-heron.me.uk/blog/2007/04/08/virtual-barbershop with ur headphone vol high.. wid 3d music, its really kewl :) n chk the more links given there Docsound 29 May 2009 8:45 pm: Calvin and Hobbes cartoon is not drawned by dadomani!

Dilbert Browser

Al Donovan has created a Dilbert repository by crawling United Media’s site every day since 1996. I’ve made them a little easier to navigate. Click here to see the Dilbert Browser. Use the left and right arrow keys to see the next comic. Comments anonymous 22 May 2007 11:26 am: Awesome. How did you do this? Amit 17 Dec 2014 7:30 am: Hey Anand, The link doesnt seem to be working anymore (or, at least, its point to C&H, which I just don’t mind, but remembered your Dilbert browser but could not find it anymore).

Calvin and Hobbes Tracer Bullet 1

My all-time favourite series from Calvin and Hobbes. ...

Calvin and Hobbes Dad explains science

My second most favourite series from Calvin and Hobbes, where Dad teaches Calvin the wonders of science. ...

Web lookup using Excel

Take a look at the Excel screenshot below. Yes, that’s right. I have a user-defined function called AMAZONPRICE. And it returns these cameras’ prices directly from Amazon.com. (Given the category and some keywords, it returns the price of the bestselling item on Amazon.com.) Here’s the code behind the function. Function AmazonPrice(index As String, keywords As String) As String Dim xDoc As MSXML2.DOMDocument30 Set xDoc = New MSXML2.DOMDocument30 xDoc.async = False If xDoc.Load("http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService" _ "&Version=2005-03-23&Operation=ItemSearch&SubscriptionId=03SDGQDFEB455W53SB82" _ "&AssociateTag=sanand-20&MinimumPrice=10000&ResponseGroup=OfferSummary,Small" _ "&Sort=salesrank&SearchIndex=" & index & "&Keywords=" & keywords) Then xDoc.setProperty "SelectionLanguage", "XPath" xDoc.setProperty "SelectionNamespaces", _ "xmlns:a=""http://webservices.amazon.com/AWSECommerceService/2005-03-23""" AmazonPrice = xDoc.selectSingleNode("/a:ItemSearchResponse//a:Amount").Text End If End Function This is how it all started… ...