我想使用python將消息發送給linkedin中的多個朋友。
來自文檔:http://code.google.com/p/python-linkedin/
使用這個可以發送。來自python的linkedin:無法發送多條消息
result = api.SendMessage("This is a subject", "This is the body", ["ID1", "ID2", "ID3"])
但我無法使用它。任何人都可以告訴我什麼是ID1? ID2?等等?
我想使用python將消息發送給linkedin中的多個朋友。
來自文檔:http://code.google.com/p/python-linkedin/
使用這個可以發送。來自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)
意味着你不能發送沒有連接到連接列表中的消息? – sam 2011-06-18 04:19:54