1.you need speical version of tweepy from https://github.com/laiso/tweepy/ this version support status_update_with_media
2.You need fswebcam program sudo apt-get install fswebcam
3.Sample code
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import tweepy
import subprocess
#You need to apply for the keys and secret from twitter api page
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
pid = subprocess.call(["fswebcam","test.jpg"])
fn = '/home/pi/talkingtweet/test.jpg'
api.status_update_with_media(fn,status='Test')
Comments