The "open()" function works a little differently depending on your environment so you may need to find out what works for you, the method below should work. Uncomment: //open("/home/your_username/twitter.trip"); ...
This instructable will show you how to construct a laser tripwire that can twitter and grab an image from a webcam, as well as execute any command you can put in a bash script.
This instructable is actually quite simple and is even suitable as a beginner arduino project. It requires a GNU/linux (or possibly Mac) operating system with the arduino IDE and Processing IDE working properly. This project could also be implemented in Windows if you created a more complex processing application.
I needed the LDR and the laser to be in a position where they would not move around so I connected my LDR and resistor directly to the Arduino without a breadboard, but you can do it however you like, below are the photos for soldering and bending them into shape I also included a simple diagram.
I cut the end off of a ballpoint pen so that I could slip it over the LDR to prevent ambient light from affecting the reading, you could also use a straw.