How to OAuth Twitter with httplib2 and Python 3.x?
I know there are a lot of Python Twitter API and OAuth wrappers out there, but I don't want to use them. I want to use nothing more than httplib2 and Python 3.x standard library. Could you please demonstrate simpl开发者_高级运维e code examples on how to achieve that? Thanks in advance.
You can look at python-oauth2. The main implementation code is very readable. Since there are a lot of thorny issues here like precisely how you encode your forms it is tricky to get right. I would recommend just using the oauth2 library, that is what I've done to integrate with Twitter (httplib2 + oauth2 + Twitter's REST/streaming APIs).
精彩评论