开发者

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 cur开发者_运维知识库l 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.


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') 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜