我在试用this Github example。
我收到一个403, Access to connections denied错误,它返回KeyError: '_total'.
存在r_network选项。有人遇到过这个问题吗?
另外,如果你看一下this Python docs page,'requests‘库除了应用程序密钥之外,还初始化了resource_owner_key和resource_owner_secret。不确定这些是如何从'rauth‘库传递过来的,我想知道是不是这导致了这个403错误。
发布于 2012-11-16 00:58:03
这可能是您在Linkedin中设置的权限的问题。键错误是由于接收到的响应是错误响应,并且在字典中不包含'_total‘键。
您可以尝试调用"http://api.linkedin.com/v1/people/~“,因为这将提供您的个人资料详细信息。
发布于 2013-03-29 12:38:11
这里是Rauth维护者。
链接的示例已过期,不应使用。相反,请尝试将rauth更新到0.5.3,并尝试使用this example。
如果问题仍然存在,我认为@Ifthikhan猜测这是权限问题可能是正确的。为了进行检查,您可以修改示例脚本以仅打印响应。下面是不同之处:
diff --git a/examples/linkedin-updates-cli.py b/examples/linkedin-updates-cli.py
index 0df692a..d78d20c 100644
--- a/examples/linkedin-updates-cli.py
+++ b/examples/linkedin-updates-cli.py
@@ -25,16 +25,4 @@ r = session.get('people/~/network/updates',
params={'type': 'SHAR', 'format': 'json'},
header_auth=True)
-updates = r.json()
-
-for i, update in enumerate(updates['values'], 1):
- if 'currentShare' not in update['updateContent']['person']:
- print '{0}. {1}'.format(i, update['updateKey'])
- continue
- current_share = update['updateContent']['person']['currentShare']
- person = current_share['author']['firstName'].encode('utf-8') + ' '
- person += current_share['author']['lastName'].encode('utf-8')
- comment = current_share.get('comment', '').encode('utf-8')
- if not comment:
- comment = current_share['content']['description'].encode('utf-8')
- print '{0}. {1} - {2}'.format(i, person, comment)
+print r.json()如果在那之后你仍然有困难,请告诉我。
https://stackoverflow.com/questions/13286300
复制相似问题