[英]Log-in to a website using Google, Facebook or Twitter accounts with Python
I am making a web application that will monitor the amount of members and discussions in each one of the groups listed here ( http://www.codecademy.com/groups#web ) and display that information in nice graphs. 我正在制作一个Web应用程序,它将监视此处列出的每个组中的成员和讨论量( http://www.codecademy.com/groups#web ),并以漂亮的图形显示该信息。
However, as you have already seen, it looks like I need to create an account and login with it. 但是,正如您已经看到的,看起来我需要创建一个帐户并使用它登录。
Having in mind that my project is using Python for the server side, how do I do it? 考虑到我的项目正在服务器端使用Python,我该怎么做? Which API is easier? 哪个API更容易? (Google, FB or twitter?) (Google,FB还是Twitter?)
I would really love if you could also provide some examples because I am really new at this (and at Python too). 如果您还可以提供一些示例,我将非常高兴,因为我在这方面(以及Python方面)确实是新手。
The official wrapper around the Twitter API for Python is this one. 围绕Python的Twitter API的官方包装是这一包装。 I used it and it's very easy. 我用过,非常简单。 You should first read this page and also register an application to get OAuth keys. 您应该首先阅读此页面 ,并注册一个应用程序以获取OAuth密钥。
Example: 例:
import twitter
# Remember to put these values
api = twitter.Api(consumer_key="",
consumer_secret="",
access_token_key="",
access_token_secret="")
# Get your timeline
print api.GetHomeTimeline()
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.