简体   繁体   English

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

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

I want to send messages to multiple friends in linkedin using python. 我想使用python将消息发送给linkedin中的多个朋友。
from docs : http://code.google.com/p/python-linkedin/ 来自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? 谁能告诉我ID1是什么? ID2? ID2? etc? 等等?

You can only message first degree connections. 您只能向一级学位联系发送消息。 So, to get valid ids, I'm guessing the code looks something like: 因此,为了获得有效的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])

They are the ID's for the people you wish to send a message to. 它们是您要向其发送消息的人员的ID。 instead of ['ID1', 'ID2', 'ID3'] , try using send_yourself = True to make sure what you are doing works. 而不是['ID1', 'ID2', 'ID3'] ,请尝试使用send_yourself = True来确保您所做的工作正常。 So it will be: 因此它将是:

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