【发布时间】:2017-05-04 05:29:53
【问题描述】:
我正试图让这个示例在 https://github.com/ozgur/python-linkedin 中运行。我用他的例子。当我运行这段代码时。我没有得到示例中提到的RETURN_URL 和authorization_code。我不知道为什么,我认为这是因为我没有正确设置HTTP API example。我找不到http_api.py,当我访问http://localhost:8080 时,我收到“无法访问此站点”。
from linkedin import linkedin
API_KEY = 'wFNJekVpDCJtRPFX812pQsJee-gt0zO4X5XmG6wcfSOSlLocxodAXNMbl0_hw3Vl'
API_SECRET = 'daJDa6_8UcnGMw1yuq9TjoO_PMKukXMo8vEMo7Qv5J-G3SPgrAV0FqFCd0TNjQyG'
RETURN_URL = 'http://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL, linkedin.PERMISSIONS.enums.values())
# Optionally one can send custom "state" value that will be returned from OAuth server
# It can be used to track your user state or something else (it's up to you)
# Be aware that this value is sent to OAuth server AS IS - make sure to encode or hash it
#authorization.state = 'your_encoded_message'
print authentication.authorization_url # open this url on your browser
application = linkedin.LinkedInApplication(authentication)
【问题讨论】:
-
请从您的 LinkedIn 帐户中删除此 API 密钥和密码!它们不应该公开分享。
标签: python linkedin linkedin-api