1
votes

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.

1
so i figured out that I can call search with keywords like this..client.search(:keywords => "homer simpson") but getting the result to return the fields I want is not working. this does not work..client.search(:keywords => "homer simpson", :fields => ["first-name", "headline"]) I always get back only the first and last name - absolutskyy

1 Answers

2
votes

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)?....