Rails linkedin gem - 有人使用过搜索功能吗?
我正在尝试使用 https://github.com/pengwynn/linkedin 的搜索功能。我在任何地方都找不到任何有关搜索功能的文档,甚至在 gem 网站/github 上也找不到。有一些关于个人资料/连接拉取的信息,但没有关于搜索功能的信息。
我想要实现的是使用 gem 在 linkedin 上进行人员搜索。我有用户在我的网站上输入的关键字。关键字可以是人名(名字、姓氏、全名)或公司名称。我想使用这些关键字在 linkedin 上进行关键字搜索。我正在寻找我的第一级连接中的关键字匹配,而不是我的扩展网络。我想要返回的是我的连接的名字、姓氏、标题和网址。我想是这样的..
client.search(:keyword => "microsoft", :fields => ["first_name", "last_name", "headline", "picture_url"])
谢谢。
I'm trying to use the search feature of https://github.com/pengwynn/linkedin. I could not find any documentation on the search feature anywhere, not even on the gem website/github. There's some info on the profile/connections pull but nothing on the search feature.
What I want to achieve is use the gem for making a people search on linkedin. I have keywords that the user enters on my site. The keyword(s) could be the name of a person (first, last, full name), or a company name. Using these keywords I want to make a keyword search on linkedin. I'm looking for keyword matches in my first level connections, not my extended network. What I want returned is the first_name, last_name, headline, and url of my connection. I guess something like this..
client.search(:keyword => "microsoft", :fields => ["first_name", "last_name", "headline", "picture_url"])
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于字段,您需要执行以下操作:
:fields => [:人=> ["first-name", "headline"]]
好吧,我不是 Ruby 程序员,所以这可能是完全伪造的语法。而且我还没有使用过这个宝石。
但关键是您要询问一组嵌套的结果字段,因此您需要生成一个如下所示的 REST URL:
http://api.linkedin.com/v1/people-search:(people:(first-name,headline))?keywords=homer%20simpson
你要求的是...人物搜索:(名字,标题)?...
For the fields you need to do something like:
:fields => [:people => ["first-name", "headline"]]
Well, I'm not a Ruby programmer, so that could be totally bogus syntax. And I've not used this gem.
But the key is that you're asking a nested set of result fields, so you need to generate a REST URL that looks like:
http://api.linkedin.com/v1/people-search:(people:(first-name,headline))?keywords=homer%20simpson
And what you are asking for is ...people-search:(first-name,headline)?....