来自 python 的 linkedin:无法发送多条消息

发布于 2024-11-15 19:20:22 字数 333 浏览 4 评论 0原文

我想使用 python 向 linkedin 中的多个朋友发送消息。
来自文档:http://code.google.com/p/python-linkedin/
使用这个可以发送那个。

result = api.SendMessage("This is a subject", "This is the body", ["ID1", "ID2", "ID3"])

但我无法使用它。谁能告诉我ID1是什么? ID2? ETC?

I want to send messages to multiple friends in linkedin using python.
from docs : http://code.google.com/p/python-linkedin/
Using this one can send that.

result = api.SendMessage("This is a subject", "This is the body", ["ID1", "ID2", "ID3"])

But I am not able to use that. Can anyyone tell me what is ID1? ID2? etc?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陪你到最终 2024-11-22 19:20:23

您只能向一级关系发送消息。因此,为了获得有效的 ID,我猜代码如下所示:

>>> connections = api.Getconnections() # connections is a list of Profile instances
>>> connections
>>> [<linkedin.linkedin.Profile object at 0x1a3d510>]
>>> connections[0].id
>>> 'js6vz2-D6x'
>>> result = api.SendMessage("This is a subject", "This is the body", [connections[0].id, connections[1].id, connections[2].id])

You can only message first degree connections. So, to get valid ids, I'm guessing the code looks something like:

>>> connections = api.Getconnections() # connections is a list of Profile instances
>>> connections
>>> [<linkedin.linkedin.Profile object at 0x1a3d510>]
>>> connections[0].id
>>> 'js6vz2-D6x'
>>> result = api.SendMessage("This is a subject", "This is the body", [connections[0].id, connections[1].id, connections[2].id])
在巴黎塔顶看东京樱花 2024-11-22 19:20:23

它们是您想要向其发送消息的人的 ID。尝试使用 send_yourself = True 来代替 ['ID1', 'ID2', 'ID3'] 来确保您正在做的事情有效。所以它将是:

result = api.SendMessage("This is a subject", "This is the body", send_yourself = True)

They are the ID's for the people you wish to send a message to. instead of ['ID1', 'ID2', 'ID3'], try using send_yourself = True to make sure what you are doing works. So it will be:

result = api.SendMessage("This is a subject", "This is the body", send_yourself = True)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文