LinkedIn 群组 API 通过 PHP 自动发布
请有人帮助我如何使用 PHP 在 linkedin 组中发布新的讨论。 如果有人能举个例子,我将不胜感激。
感谢您的所有回复。
可爱的程序员:)
Some one please help me how to post a new discussion in linkedin group using PHP.
I would appreciated if some one comes with an example.
Thanks for all replies.
Cute programmer :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过此处最新版本的 Simple-LinkedIn 库使用 PHP 访问 Groups API:
http: //code.google.com/p/simple-linkedinphp/
发行说明,涵盖特定于组的方法的添加。要使用该库回答您的问题,您需要执行以下操作:
You can access the Groups API using PHP via the latest version of the Simple-LinkedIn library here:
http://code.google.com/p/simple-linkedinphp/
The release notes, covering the additions of the Groups-specific methods. TO answer your question using the library, you'd do something along the lines of the following:
简短的回答,你不能。
答案很长,即使在承诺了 2 年之后,Linked-in 仍然没有为群组管理提供合适的 API,尽管我自己(我是 LI 群组经理)和许多拥有和/或管理 LI 群组的其他人反复询问。
现在...从另一个角度来看:
您实际上并不需要 API 来发布,毕竟它只是我们服务器的 html,但是即使使用 LI,如果没有用户登录,您也无法执行任何操作,这意味着 oauth 代码让您登录、创建帐户、获取登录令牌,然后提供该令牌和大量更多信息,以及讨论的语义。
简而言之,即使是开放的小组,这也不会是一个简单的帖子,而且对于这样一个简单的任务,它需要您做大量的工作。
但是,如果您坚持的话,那么我会从安装 fiddler 等工具开始。 wire-shark,然后分析 LI 上的手动会话并观察登录、创建帖子等的过程......端到端,以便您了解发送的内容。一旦你做到了这一点,那么就只是用 PHP 重现它的问题了。顺便说一句,
如果你希望它编写一个自动垃圾邮件发送工具,我真的不会打扰,因为它一被看到,它就会关闭-关闭并阻止 LI 管理层使用。
更新:
查看OP提供的链接,现在似乎有一个组API,我不得不说,当组所有者询问时,LI对此保持非常沉默(因此我之前做过大量的屏幕抓取现在)
继续,查看您提供的示例链接:
http://api.linkedin.com/v1/groups/12345/posts:(title,summary,creator)?order=recency
我还不知道API(一些调查是必需的)但是,有一点很突出,那就是它看起来像您
A)需要一个帐户
B) 需要 API 密钥(大概是这样 LI 可以跟踪您的使用情况)
C) 需要执行某种 OAuth 身份验证并登录才能使用。
就目前情况而言,我建议您按照我即将要做的操作并阅读所有文档。 :-)
我们都在这里学到了新东西。
Short answer, you can't.
Long answer, even after 2 years of promising Linked-in still have not produced a suitable API for groups management, despite myself (I'm an LI group manager) and many others who own and/or manage groups on LI repeatedly asking.
now... to look at it from the other point of view:
You don't really need an API to post, after all it is just a html we server, however even with LI you can't do anything without a user login, and that means oauth code to log you in, creation of account, getting a login token and then providing that and a ton more information, as well as the semantics of the discussion.
In short it's not going to be a simple post, even with groups that are open, and for such a simple task it's going to require you a lot of work.
However, if your adamant, then I would start by installing tools like fiddler & wire-shark, then analysing a manual session on LI and observing the process of logging in, creating posts etc ... end to end, so you understand what's sent where. Once you've done that, it's then just a question of reproducing that in PHP
If your wanting this to write an automated spamming tool by the way, I really wouldn't bother, because the second it gets seen, it will get shut-down and prevented from being used by LI management.
UPDATE:
Looking at the links provided by the OP it appears there is a groups API now, and I have to say it's something that LI remain very quiet about when asked by group owners (Hence the large amount of screen scraping I've done before now)
Moving on, and looking at the sample link you provided:
http://api.linkedin.com/v1/groups/12345/posts:(title,summary,creator)?order=recency
I don't know the API yet (Some investigation is required) but, one thing that sticks out is it looks like you
A) Need an account
B) Need to an API key (Presumably so LI can track your usage)
C) Need to have performed some kind of OAuth authentication and logged in before you can use it.
As things stand, I would recommend that you do what I'm about to and read through all the docs. :-)
We've both learned something new here.