本文整理汇总了Python中aweber_api.AWeberAPI.get_request_token方法的典型用法代码示例。如果您正苦于以下问题:Python AWeberAPI.get_request_token方法的具体用法?Python AWeberAPI.get_request_token怎么用?Python AWeberAPI.get_request_token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aweber_api.AWeberAPI
的用法示例。
在下文中一共展示了AWeberAPI.get_request_token方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AWeberAPI
# 需要导入模块: from aweber_api import AWeberAPI [as 别名]
# 或者: from aweber_api.AWeberAPI import get_request_token [as 别名]
from aweber_api import AWeberAPI
# replace XXX with your keys
consumer_key = 'Ak7W3K2vE3pODdOyag0t5X79'
consumer_secret = 'ekxdnHs8aPgHIlI6RBLk3BynpylWEHCzSr4042vP'
# create new instance of AWeberAPI
application = AWeberAPI(consumer_key, consumer_secret)
# get a request token
request_token, token_secret = application.get_request_token('oob')
# prompt user to go to the auth url
print 'Go to this url in your browser: %s' % application.authorize_url
# prompt for verifier code
code = raw_input('Type code here: ')
# exchange request token + verifier code for access token
application.user.request_token = request_token
application.user.token_secret = token_secret
application.user.verifier = code
access_token, access_secret = application.get_access_token()
# show the results
print access_token, access_secret