繁体   English   中英

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

[英]linkedin from python : unable to send multiple messages

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

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

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

您只能向一级学位联系发送消息。 因此,为了获得有效的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])

它们是您要向其发送消息的人员的ID。 而不是['ID1', 'ID2', 'ID3'] ,请尝试使用send_yourself = True来确保您所做的工作正常。 因此它将是:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM