无需访问网站即可获得 Tumblr 令牌?
Get Tumblr Tokens without having to go to a website?
我正在使用 PyTumblr。我有 Consumer Key & Consumer Secret 并且我正在尝试请求 Access token 和令牌秘密
在 pytumblr github 页面他们说:
Two easy ways to get your credentials to are:
- The built-in interactive_console.py tool (if you already have a
consumer key & secret)
- The Tumblr API console at https://api.tumblr.com/console
哦,不错,但是 interactive_console.py
等待用户交互。基本上它会把你带到一个网页来自动化你想要访问的 Tumblr 应用程序。
如您所见:
https://github.com/tumblr/pytumblr/blob/master/interactive_console.py
他们说:
# Redirect to authentication page
print '\nPlease go here and authorize:\n%s?oauth_token=%s' % (authorize_url, request_token['oauth_token'][0])
redirect_response = raw_input('Allow then paste the full redirect URL here:\n')
而第二种方式是直接访问网站。
我的问题是:有没有办法在不与网站交互(仅以编程方式)的情况下获取令牌以对其进行自动化,然后获取令牌?
谢谢!
没有。 Tumblr 使用 oauth,这需要创建每会话密钥才能与服务交互。
我正在使用 PyTumblr。我有 Consumer Key & Consumer Secret 并且我正在尝试请求 Access token 和令牌秘密
在 pytumblr github 页面他们说:
Two easy ways to get your credentials to are:
- The built-in interactive_console.py tool (if you already have a consumer key & secret)
- The Tumblr API console at https://api.tumblr.com/console
哦,不错,但是 interactive_console.py
等待用户交互。基本上它会把你带到一个网页来自动化你想要访问的 Tumblr 应用程序。
如您所见: https://github.com/tumblr/pytumblr/blob/master/interactive_console.py
他们说:
# Redirect to authentication page
print '\nPlease go here and authorize:\n%s?oauth_token=%s' % (authorize_url, request_token['oauth_token'][0])
redirect_response = raw_input('Allow then paste the full redirect URL here:\n')
而第二种方式是直接访问网站。
我的问题是:有没有办法在不与网站交互(仅以编程方式)的情况下获取令牌以对其进行自动化,然后获取令牌?
谢谢!
没有。 Tumblr 使用 oauth,这需要创建每会话密钥才能与服务交互。