Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tweet from Django?

I want to create a manage.py command that takes an object from a queryset and posts it on my Twitter. I was going to use the curl method as described in here.

But Twitter has since disabled basic authentication. I don't want to install an overkill library like Tweepy that lets people authenticate to my site with oAuth, I just simply want to tweet. On a single account.

like image 515
Anton Rissanen Avatar asked Mar 13 '11 12:03

Anton Rissanen


1 Answers

from twitter api page:

For applications with single-user use cases, we now offer the ability to issue an access token for your own account (and your own applications). You can generate these keys from your application details pages. Find out more about using a single access token.

go to https://dev.twitter.com/apps to get your keys

from there on out, python-twitter will be happy to parse these keys for you with

api = twitter.Api(consumer_key='consumer_key', consumer_secret='consumer_secret', 
          access_token_key='access_token', access_token_secret='access_token_secret') 
like image 120
Thomas Avatar answered Sep 22 '22 23:09

Thomas