def quick_api(api_key, secret_key, port=8000):
"""
This method helps you get access to linkedin api quickly when using it
from the interpreter.
Notice that this method creates http server and wait for a request, so it
shouldn't be used in real production code - it's just an helper for debugging
The usage is basically:
api = quick_api(KEY, SECRET)
After you do that, it will print a URL to the screen which you must go in
and allow the access, after you do that, the method will return with the api
object.
"""
auth = LinkedInAuthentication(api_key, secret_key, 'http://localhost:8000/',
list(PERMISSIONS.enums.values()))
app = LinkedInApplication(authentication=auth)
print(auth.authorization_url)
_wait_for_user_to_enter_browser(app, port)
return app
评论列表
文章目录