Taking and Tweeting a Photo with Raspberry Pi @Raspberry_Pi #piday #raspberrypi
Raspi.tv has posted part 4 of their pi twitter app series and this week the lesson is how to take a tweet photos using your pi.
Today it gets a bit more exciting. We’re going to take a photo with the Raspberry Pi camera and tweet it.
These are basic building blocks for manipulating a twitter account from your Raspberry Pi. So what do we need to know about tweeting photos?
The maximum photo file size you can upload to a tweet is 3Mb. This is plenty for the kind of photos I’m thinking about. I’m going to use 1024 x 768 pixels, which is adequate resolution for twitter. It’s a lot less than the Pi camera is capable of, but you can tweak it in your script if you want to use the full 3Mb allowance.
Unfortunately, although tweepy is quite a good Python library, its documentation is rather out of date. I had no idea how to tweet a photo, but last week I happened across a post by Dougie Lawson on the Raspberry Pi Forums (Python section). This gave me most of what I needed to be able to tweet a photo.
Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, or even use Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for MakeCode, CircuitPython, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.