I was wondering how you would tweet pictures on the Pi through Python. I can't use Twython for a reason that is too long to go into.
Code: Select all
#!/usr/bin/python import os import sys import tweepy Ckey = 'Consumer_Key_here' Csec = 'Consumer_Secret_here' Akey = 'Application_Key_here' Asec = 'Application_Secret_here' auth = tweepy.OAuthHandler(Ckey, Csec) auth.set_access_token(Akey, Asec) twapi = tweepy.API(auth) fn = os.path.abspath(sys.argv) status = sys.argv twapi.update_with_media(fn, status=status)
I took ages finding a working version. V2.2 was the third one I tried. There was a old fork of tweepy code that didn't work with https.alexeames wrote: Couldn't get the booger working until I updated tweepy (which I only installed in September 2013) to 2.2. Then it worked fine.
I used to do back-end stuff for websites in PERL. I've got a shopping cart and banner ad server I wrote 10 years ago still working.DougieLawson wrote:Most of my machine generated tweets come from a Perl program use Net::Twitter. I'm not a big fan of python. I prefer the write once, debug never feature of Perl to the semantic white space feature of python.