I've got a 2G iPhone and a limited budget and wanted in on this barcode-scanning fun as well. I googled some things and was inspired by this, but it wasn't quite what I wanted. I finally came up with the following cheap (free) solution.
What you need:
-a disposable camera. You can get these from most any photo counter, for processing they just crack the film out and will recycle the rest. They'll usually give you a handful of cameras for free if you tell them you're doing a project.
-a flathead screwdriver or something else to pry the camera case open.
-a flexible iPhone case. Not necessary, but you've gotta mount the lens somehow. I got a case for $5 at 5 Below.
Step 1: Assess the salvaged disposable camera
WARNING!!! These cameras have a large capacitor for the flash which can give you a very damaging shock if you touch it. Stay away from the circuit board or you may get injured. The people at the photo place will probably warn you about this as well. You should probably wear safety goggles for this project.
Also, do NOT press the "flash" button before you start to take apart the camera, or you can be sure that you've made the project a lot more dangerous than it needs to be.
Step 2: Crack it open
Step 3: Remove the lens
If you're using a different type of camera, such as the Fuji shown, the lens may be one piece that slides out. This is good too, but may be harder to mount to your case.
Step 4: Testing the lens
In the first set of pictures, without the lens, the barcode is blurry and will not work with snappr.net app. In the second set, with the lens applied, the barcode scans fine.
Note that even with the macro lens it takes some finagling to get the barcode to be recognized by the app. It's not perfect, but is really promising. Also, some books have huge barcodes and don't work so well with this lens.
Step 5: Mounting the lens (temporarily)
This is the simplest method, but you'll need to slide the lens out of the way for taking normal shots. It can also slide around and you could lose it. I recommend a more permanant system as shown in the next step.
Step 6: Mounting the lens (more permanently)
Next slide the fastener through the lens and case hole and spread the paper fastener's wings so they curl into the case. Put a piece of transparent tape over it to discourage scratching the iPhone (you could use something industrial but I wanted to keep up the clear case effect). Now just slide the lens over the camera whenever you want to use the macro!
I'd like to have mounted the lens inside the case and cut some of it away, but I thought I'd quit while I was ahead.
Also note that the app SnapTell (AppStore link) is pretty fantastic-- it basically bypasses barcodes and does image recognition on pictures you take of objects. Basically a Shazam for products. Right now it's only for CDs, DVDs, and games, but can you imagine what either of these technologies could do for grocery shopping!?