Goodreads+webcam+python+zbar == hackfun!
Leo mucho, y me gusta que puedo ver las opiniones de otra gente antes de empezar un libro, y puedo poner comentarios, y que anduve leyendo, y otras cosas.
De hecho, goodreads va a ser una parte importante de un proyecto que estamos empezando con gente de PyAr.
Una cosa que no vengo haciendo es agregar los libros que tengo en goodreads, porque es mucho laburo.
Bueno, ya no tanto!
Así se hace, al estilo hacker...
Instalá zbar
Conseguite una webcam barata
Agarrá un libro
Un programita python de 7 líneas (ver abajo)
¿No es lindo?
El programa:
A good idea. I am acutally en route to sell some of my old books on the internet and thought about buying a barcode scanner. But this is so obviously a better idea as all my computers have a camera build in. Thanks for the idea!
Glad it was useful :-)
Hi, there Robert!
I've tried your 7-line python script, but I had to do some changes. so your code is working for me now, like this:
import os
p=os.popen('LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam /dev/video1','r')
while True:
code = p.readline()
print 'Got barcode:', code
isbn = code.split(':')[1]
os.system('firefox http://www.goodreads.com/se...
In order to use my Creative WebCam Plus, I had to add the line:
"LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so" before "zbarcam" and after it. "/dev/video1" because I'm using the script on a laptop with a built-in webcam, but that's the one I don't want to use, because isn't in focus. The one I want to use is the Creative one, plugged via USB with a ring to focus it.
The other change is the browser.
I don't use Chrome, so I changed "chrome" for "firefox" and everything works like a charm.
Thanks for your script.
I also want to share with you a video I uploaded to YouTube, using Zbar to search any item with a barcode using Google, or another program. I used another tiny program called "crikey" that allow me to use the read barcode anywhere I want....
Here is the videoclip:
http://www.youtube.com/watc...
I got the info from here:
http://www.tuxbrain.com/con...
Now I've got a question. How can I do the same on Windows? I mean, how can I use the read barcode from Zbar, anywhere I want? Is there a way to redirect the output of the webcam to any open search box, active window (NotePad, for example) or search box on any application?
If you've got any idea, please, contact me at fmft71 at yahoo dot es
También hablo y entiendo Español, sin ningún problema.... OK?
Very cool! I'm curious to see if zbar works on Windows or (preferably) OS X. Nice hack!
It seems the webcam support is not available for windows, and the scanner that uses images is much harder to get working right.
When working with video, you just move it around until it clicks, with snapshots it's a pin in the neck.
Thanks a ton, am also reading your PyQT tutorials. There are some typos in tutorials.
do you know how to connect zbar to a database eg google and search and print the deatails found
Actually, yes, we ahve implemented that in Aranduka: http://aranduka.googlecode.com
You want the google_guesser and barcode plugins (integrate branch) for the sample code. Of course, some glue will be required to make them work outside Aranduka.
is there a way of getting this to work on a win box. I copied the code and defined the location of zbar. why am I not able to scan the code. It just does not start the zbar program
kriskrimson@ymail.com