Categories
Linux Video

My Cat Bubba Posts Videos and Twitters using an EeePC and Ubuntu

MAKE blogged about plants that notify the owner via text message or Twitter status update that they need water, and even thank their owners when they’re watered. This got me thinking – why not a cat who sends a tweet when he’s eating? While I’m at it, why not toss in a video stream? After […]

MAKE blogged about plants that notify the owner via text message or Twitter status update that they need water, and even thank their owners when they’re watered.

This got me thinking – why not a cat who sends a tweet when he’s eating? While I’m at it, why not toss in a video stream? After all, everyone loves videos of their cat. My ASUS eeePC runs eeexubuntu and has a webcam – all I would need to do to get my cat twittering is setup some motion sensing software that detects movement from the webcam, records a video, and upload to my server and then notifies me.

First, a proper “cat studio” is required. I picked up a laundry basket, some thin anti-slip mat and a couple of new food bowls for under $15 total. The laundry basked got a side removed by my trusty Dremel tool, and the anti-slip mat was cut to fit and hot-glued in place. After that was done, I had a spare light fixture with a clamp lying around to add to the mix for better lighting.

Motion is a great webcam application that fits my needs exactly. More specifically, when it detects motion, it records a video – think like a security camera, but way, way smarter. When Motion no longer senses any movement after a defined period of time, it encodes the captured video, and then it can run a script or set of commands afterwards. Bingo!

Here’s how I did it, after hours of trial and error:
1. Installed Motion 3.2.9
2. Configured and tweaked /etc/motion/motion.conf (probably still some changes needed)
3. Setup SSH to allow logins to my web server without a password.
4. Added the following to execute when a recording is finished:
Upload the file (using cat, of course!):

cat /tmp/motion/video.swf | ssh fsckin@fsckin.com cat ">" /home/fsckin/fsckin.com/bubba/video.swf

Update Twitter Status:

curl --basic --user "junglecrawler:password" --data-ascii "status=Done eating, humans were nice to me today." "http://twitter.com/statuses/update.json"

Remove the video off the local machine:

rm /tmp/motion/video.swf

Here’s the end result:
First Video:
[flash http://www.fsckin.com/bubba/video3660-first.swf]

Latest Video (15MBish)

This videos loop over and over. Also – if a video is uploading at the same time that someone is loading the page, it might break. If you don’t see video, just count to 10 and refresh the page. If you still get nothing, bookmark this on del.icio.us and come back later.

Note: Audio is not yet supported by Motion, however, an experimental patch enables this already and should be be in the next version. This is a proof of concept, and it will probably be running for at least the next week – after that, who knows. All I know is after I’m long forgotten, Bubba will live in perpetuity as truly the first cat who uploaded videos of himself eating and sending tweets to his human slaves.

Follow Bubba on Twitter. Or, follow his slave, Wayne.

13 replies on “My Cat Bubba Posts Videos and Twitters using an EeePC and Ubuntu”

Thanks Wayne. Just yesterday I was thinking to myself, “it sure would be nice if I could find a linux webcam app. that supports motion detection” and BLAMO there it is!

You might try using “scp” instead of
piping through ssh.

scp video.swf fsckin@fscat:/home/fsckin/fsckin.com/bubba/

should do the trick. You’ll still need the passwordless logins, but this is certainly a ot cleaner, and might help with the upload
while viewing bug.

Great post, as usual!

首长:同志们好!士兵:首长好!首长拍一士兵的胸部说:这肌肉练得多好!士兵:报告首长,我是女兵,首长这才发现是个美女士兵!!

美女的短信:天气预报:今天凌晨到白天有时有想你,下午转大到暴想,预计心情将由此降低五度。受延长低气压带影响,预计此类天气将持续到见到你为止。

Leave a Reply

Your email address will not be published. Required fields are marked *