Geektastic
Jan. 3rd, 2007 02:15 pmSo last year I bought a :Cue:Cat scanner off of ebay. It's just a USB scanner that acts like a keyboard. Yes, it looks bloody stupid, but it was cheap. It seems like it's already been hacked because when I swiped a barcode then the computer responded is if I'd typed in the numbers represented by the barcode _and_ pressed return.
Well, that's a fun $10. Now what to do with it?
So I scanned a book into the search bar on Amazon. Hey, it found the book. Neat! I wonder if I could automate this. Maybe somehow link it to my database of books?
So I signed up for a free Amazon Web Services account. This allows you to make structured requests of the Amazon database. And I wrote a quick perl script to decode the resulting XML output
Well, this looks promissing. Ugh. Not all books are found. Sometimes it searches better using ISBN rather than EAN (but that's OK; the ISBN is calculable from EAN). So I decided to scan all my books. Confusing American edition books typically have two barcodes on them; one on the back and one inside the front cover. The inside one is an EAN, the one on the back is possibly a UPC. Books published this year seem to have the EAN on both the back and inside cover. So I scanned both numbers, just in case. I got quite efficient at it.
1119 books scanned. 39 books didn't have any barcodes at all, so I had to manually enter whatever number I could find (hopefully they're ISBNs or ISBNs can be recreated from them. Mostly books from before 1980). 1 book did have a barcode but it had been covered by a shop label which had stuck too hard to remove, so I manually entered that as well. And 1 book had no codes at all! No barcodes, no ISBN, no EAN... I had to google for something for that!
So for 3 hours work on Monday night I now have a wodge of numbers to look up. Then, maybe, I can make my list prettier :-)
Well, that's a fun $10. Now what to do with it?
So I scanned a book into the search bar on Amazon. Hey, it found the book. Neat! I wonder if I could automate this. Maybe somehow link it to my database of books?
So I signed up for a free Amazon Web Services account. This allows you to make structured requests of the Amazon database. And I wrote a quick perl script to decode the resulting XML output
% ./book-by-id 9780441014231 Author: Robert Asprin, Peter J. Heck Title: Phule's Errand (Ace Science Fiction) Label: Ace EAN: 9780441014231 ISBN: 0441014232 imgs: http://ec2.images-amazon.com/images/P/0441014232.01._SCTHUMBZZZ_V56620090_.jpg imgm: http://ec2.images-amazon.com/images/P/0441014232.01._SCMZZZZZZZ_V56620090_.jpg imgl: http://ec1.images-amazon.com/images/P/0441014232.01._SCLZZZZZZZ_V56620090_.jpg
Well, this looks promissing. Ugh. Not all books are found. Sometimes it searches better using ISBN rather than EAN (but that's OK; the ISBN is calculable from EAN). So I decided to scan all my books. Confusing American edition books typically have two barcodes on them; one on the back and one inside the front cover. The inside one is an EAN, the one on the back is possibly a UPC. Books published this year seem to have the EAN on both the back and inside cover. So I scanned both numbers, just in case. I got quite efficient at it.
1119 books scanned. 39 books didn't have any barcodes at all, so I had to manually enter whatever number I could find (hopefully they're ISBNs or ISBNs can be recreated from them. Mostly books from before 1980). 1 book did have a barcode but it had been covered by a shop label which had stuck too hard to remove, so I manually entered that as well. And 1 book had no codes at all! No barcodes, no ISBN, no EAN... I had to google for something for that!
So for 3 hours work on Monday night I now have a wodge of numbers to look up. Then, maybe, I can make my list prettier :-)