emorikawa / linkedin-oauth2

Ruby wrapper for the LinkedIn OAuth2 API
Other
70 stars 86 forks source link

Using many facets on company search doesn't work #5

Closed yashke closed 10 years ago

yashke commented 10 years ago

When you try to use more than 1 facet the library make incorrect request - instead of setting facet get param for each facet it merges facets into one splitted by "+" - the request is incorrect and ends up with error.

Even worse is that after fixing the way facet params are interpreted new problem occurs - the facet params are merged into one. And it happens because of incorrect behaviour of Faraday, dependency of OAuth - it uses hash to store get params, so only last assignment to "facet" key remains.

I suggest to split this gem into 2 parts: authorization and API wrapper. The authorization part could use OAuth as dependency, but wrapper should use Net::HTTP or i.e. HTTPClient.

What do you think?

emorikawa commented 10 years ago

The search functionality has been significantly upgraded and fixed. Facets, including complex ones with multiple filtering criteria should work now.

You can see the source here: https://github.com/emorikawa/linkedin-oauth2/blob/master/lib/linked_in/search.rb

Also, your suggestion of splitting the auth & api was very well received. Check out the new gem. Thank you!

yashke commented 10 years ago

Thanks for the update - I'll try it out next week.