python的单api实现

open-singl的Python项目详细描述


python的单api实现

安装

pip install open-singly

pip install git+https://github.com/MagicSolutions/open-singly.git

如何使用

from open_singly import Singly

client_id = 'My_Client_ID'
client_secret = 'My_Client_Secret'
redirect_uri = 'http://www.mywebsite.com/singly/callback/'

singly = Singly(client_id, client_secret, redirect_uri)

# Get authentication URL for facebook for example
auth_url = singly.get_authentication_url('facebook')

# The user must be redirected to this URL. After authentication
# Singly will redirect user to your redirect_uri
# in the GET parameters there will be a code which You must
# provide to Singly.authenticate metod

api = singly.authenticate(code)

# After successfull authentication you can execute all methods
# provided from Singly API like that

all_profiles = api.profile.get(verify='true')

facebook_data = api.profiles.facebook.get()

facebook_friends = api.services.facebook.friends.get()

享受吧!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java需要64位jdk 1.5 for windows   eclipse运算符+对于参数类型java是未定义的。双,爪哇。双人   未下载文件扩展名为的java文件   java不支持带有POST的媒体类型   从动态创建的多个EditText读取文本时发生java错误   java无法为同一xpath单击多个按钮   如何在Java中动态格式化字符串   java Android Clear Middle活动   多线程Java内存模型volatile和x86   git在Java中通过Jgit忽略文件或文件夹   java“决策无法区分输入的备选方案1、2…”   子类的javajpa继承   java需要弄清楚如何操作mutator来弄清楚一个类,教授说,我对如何操作感到困惑   java如何使用JDBC将数据从文件复制到PostgreSQL?