Book details from ISBN
When my Father decided to make a shelf-wise catalog of the books that we have in our house, I got an idea. The idea is to fetch book details from ISBN numbers; ISBN numbers are easily available from the bar-codes.
First I used a software to read the bar-codes with my webcam and store it as a text file of ISBN numbers with each line occupied by a number. Then I checked up the isbndb.com and found out the request pattern. I also found out that there is a redirection involved.
Now I simply put it all together in Python. I read the ISBN number and parsed it as a HTTP request. Once I got the response, it got tricky. I had to Google a bit to find a decent HTML parser. Once I got the HTML parser running, I could redirect my program to the main book page, from where I can scrape the book details.
And that was it, my ISBN scraper was done. The current version reads ISBN from a text file and then puts the book title and author along with the ISBN on another text file which will be named after the corresponding shelf.
The laptop webcam is crappy for bar-code reading, so looking forward to get a new web-cam (preferably HD). My next version may have bar-code reading feature built-in with them so that I can actually fetch the book detail directly when the bar-code is read. Other plans include nice looking XML output for easy reading and parsing and GUI.
I ran it in Python 2.7.2, not really used to Python 3.x you see. :)
I used only a single external module, that is BeautifulSoup for HTML parsing (which turned out to be really really useful). If you are running it, you should install BeautifulSoup first.
My code is here.