Esempio n. 1
0
def weibo_auth():
	keys = {'app_key','app_secret','redirect_uri','username','password'}
	for key in keys:
		if(request.form.has_key(key) == False):
			return jsonify(
					error=True,
					msg='mission param:'+key
			)

	app_key = request.form['app_key']
	app_secret = request.form['app_secret']
	redirect_uri = request.form['redirect_uri']
	username = request.form['username']
	password = request.form['password']

	app = WeiboAutoAuth(app_key,app_secret,redirect_uri,username,password)
	d = json.loads(app.get_access_token())
	d['error'] = False
	return jsonify(d)
Esempio n. 2
0
# -*- coding: utf8 -*-
from weibo import WeiboAutoAuth

app_key = "3530915833"  # 请修改成您的app_key
app_secret = "f34a9eb3404c7f99b5e8466e18ce9b6e"  # 请修改成您的app_secret
redirect_uri = "http://snsapi.sinaapp.com/auth.php"  # 请修改成您的redirect_uri
username = ""  # 请修改成您的测试用户名
password = ""  # 请修改成您的测试微博密码

api = WeiboAutoAuth(app_key, app_secret, redirect_uri, username, password)

print api.get_access_token()
Esempio n. 3
0
# -*- coding: utf8 -*-
from weibo import WeiboAutoAuth

app_key = '3530915833' #请修改成您的app_key
app_secret = 'f34a9eb3404c7f99b5e8466e18ce9b6e' #请修改成您的app_secret
redirect_uri = 'http://snsapi.sinaapp.com/auth.php' #请修改成您的redirect_uri
username = '' #请修改成您的测试用户名
password = '' #请修改成您的测试微博密码

api = WeiboAutoAuth(app_key,app_secret,redirect_uri,username,password)

print api.get_access_token()