From 61b9b218b1f587babcaf205d70596cc275ba2f11 Mon Sep 17 00:00:00 2001 From: Dylan Drop Date: Thu, 31 May 2012 17:24:12 -0400 Subject: [PATCH 001/117] Added current user's shares as an option (client.shares) --- lib/linked_in/api/query_methods.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 20a4907a..1e072f9b 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -27,6 +27,11 @@ def group_memberships(options = {}) path = "#{person_path(options)}/group-memberships" simple_query(path, options) end + + def shares(options={}) + path = "#{person_path(options)}/network/updates?type=SHAR&scope=self" + simple_query(path, options) + end private From f32f2eb5dabf0804685a600049b37eca77a556ad Mon Sep 17 00:00:00 2001 From: Vivek Khokhar Date: Tue, 3 Jul 2012 22:51:29 +0530 Subject: [PATCH 002/117] make update_comment functional --- lib/linked_in/api/update_methods.rb | 9 +++++---- spec/cases/api_spec.rb | 12 +++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index f69e2d04..55d51def 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -21,10 +21,11 @@ def join_group(group_id) # post(path, share_to_xml(defaults.merge(options))) # end # - # def update_comment(network_key, comment) - # path = "/people/~/network/updates/key=#{network_key}/update-comments" - # post(path, comment_to_xml(comment)) - # end + def update_comment(network_key, comment) + path = "/people/~/network/updates/key=#{network_key}/update-comments" + body = {'comment' => comment} + post(path, body.to_json, "Content-Type" => "application/json") + end # # def update_network(message) # path = "/people/~/person-activities" diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 6398138d..5eae086b 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -41,7 +41,8 @@ end it "should be able to search with an option and fetch specific fields" do - stub_request(:get, "https://api.linkedin.com/v1/people-search:(num-results,total)?first-name=Javan").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/people-search:(num-results,total)?first-name=Javan").to_return( + :body => "{}") client.search(:first_name => "Javan", :fields => ["num_results", "total"]).should be_an_instance_of(LinkedIn::Mash) end @@ -52,6 +53,14 @@ response.code.should == "201" end + it "should be able to comment on network update" do + stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return( + :body => "", :status => 201) + response = client.update_comment('SOMEKEY', "Testing, 1, 2, 3") + response.body.should == "" + response.code.should == "201" + end + it "should be able to send a message" do stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201) response = client.send_message("subject", "body", ["recip1", "recip2"]) @@ -60,6 +69,7 @@ end + context "Company API" do use_vcr_cassette From 35e65b3689f2a90de0a1c440922e9b67e265f0ab Mon Sep 17 00:00:00 2001 From: Slavik Derevyanko Date: Mon, 6 Aug 2012 12:20:37 -0400 Subject: [PATCH 003/117] Methods to work with comments/likes for share --- lib/linked_in/api/query_methods.rb | 10 ++++++++++ lib/linked_in/api/update_methods.rb | 11 +++++++++++ spec/cases/api_spec.rb | 28 ++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 1e072f9b..5631b93f 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -33,6 +33,16 @@ def shares(options={}) simple_query(path, options) end + def share_comments(update_key, options={}) + path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments" + simple_query(path, options) + end + + def share_likes(update_key, options={}) + path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" + simple_query(path, options) + end + private def simple_query(path, options={}) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 55d51def..396b69f9 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -32,6 +32,17 @@ def update_comment(network_key, comment) # post(path, network_update_to_xml(message)) # end # + + def like_share(network_key) + path = "/people/~/network/updates/key=#{network_key}/is-liked" + put(path, 'true', "Content-Type" => "application/json") + end + + def unlike_share(network_key) + path = "/people/~/network/updates/key=#{network_key}/is-liked" + put(path, 'false', "Content-Type" => "application/json") + end + def send_message(subject, body, recipient_paths) path = "/people/~/mailbox" diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 5eae086b..badc2d94 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -29,6 +29,16 @@ stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates").to_return(:body => "{}") client.network_updates.should be_an_instance_of(LinkedIn::Mash) end + + it "should be able to view network_update's comments" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/update-comments").to_return(:body => "{}") + client.share_comments("network_update_key").should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view network_update's likes" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/likes").to_return(:body => "{}") + client.share_likes("network_update_key").should be_an_instance_of(LinkedIn::Mash) + end it "should be able to search with a keyword if given a String" do stub_request(:get, "https://api.linkedin.com/v1/people-search?keywords=business").to_return(:body => "{}") @@ -67,8 +77,22 @@ response.body.should == "" response.code.should == "201" end - - + + it "should be able to like a network update" do + stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). + with(:body => "true").to_return(:body => "", :status => 201) + response = client.like_share('SOMEKEY') + response.body.should == nil + response.code.should == "201" + end + + it "should be able to unlike a network update" do + stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). + with(:body => "false").to_return(:body => "", :status => 201) + response = client.unlike_share('SOMEKEY') + response.body.should == nil + response.code.should == "201" + end context "Company API" do use_vcr_cassette From ae283b09b12085b4928231a8fe205cb753d1b31a Mon Sep 17 00:00:00 2001 From: Rajesh Date: Sat, 8 Sep 2012 17:00:21 -0700 Subject: [PATCH 004/117] fix to be able to pass the permission scope --- lib/linked_in/helpers/authorization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/helpers/authorization.rb b/lib/linked_in/helpers/authorization.rb index c691c9e8..386fc4bd 100644 --- a/lib/linked_in/helpers/authorization.rb +++ b/lib/linked_in/helpers/authorization.rb @@ -19,7 +19,7 @@ def consumer # Options: # :oauth_callback => String, url that LinkedIn should redirect to def request_token(options={}) - @request_token ||= consumer.get_request_token(options) + @request_token ||= consumer.get_request_token(options, *arguments, &block) end # For web apps use params[:oauth_verifier], for desktop apps, From 9493b2e814a8e0d980f28cacef78b5b65817a8a2 Mon Sep 17 00:00:00 2001 From: Rajesh Date: Sat, 8 Sep 2012 17:13:57 -0700 Subject: [PATCH 005/117] fix the permission param passing --- lib/linked_in/helpers/authorization.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/helpers/authorization.rb b/lib/linked_in/helpers/authorization.rb index 386fc4bd..d7e77913 100644 --- a/lib/linked_in/helpers/authorization.rb +++ b/lib/linked_in/helpers/authorization.rb @@ -18,7 +18,7 @@ def consumer # Note: If using oauth with a web app, be sure to provide :oauth_callback. # Options: # :oauth_callback => String, url that LinkedIn should redirect to - def request_token(options={}) + def request_token(options={}, *arguments, &block) @request_token ||= consumer.get_request_token(options, *arguments, &block) end From 44d6bbed231d9fc8fcf0a1cba6eab6badb16f007 Mon Sep 17 00:00:00 2001 From: Rajesh Date: Tue, 18 Sep 2012 10:49:15 -0700 Subject: [PATCH 006/117] Add test that right params are passed to OAuth gem --- spec/cases/api_spec.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index badc2d94..14fa79ad 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -29,12 +29,12 @@ stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates").to_return(:body => "{}") client.network_updates.should be_an_instance_of(LinkedIn::Mash) end - + it "should be able to view network_update's comments" do stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/update-comments").to_return(:body => "{}") client.share_comments("network_update_key").should be_an_instance_of(LinkedIn::Mash) end - + it "should be able to view network_update's likes" do stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/likes").to_return(:body => "{}") client.share_likes("network_update_key").should be_an_instance_of(LinkedIn::Mash) @@ -77,7 +77,7 @@ response.body.should == "" response.code.should == "201" end - + it "should be able to like a network update" do stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). with(:body => "true").to_return(:body => "", :status => 201) @@ -85,7 +85,7 @@ response.body.should == nil response.code.should == "201" end - + it "should be able to unlike a network update" do stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). with(:body => "false").to_return(:body => "", :status => 201) @@ -94,6 +94,17 @@ response.code.should == "201" end + it "should be able to pass down the additional arguments to OAuth's get_request_token" do + consumer.should_receive(:get_request_token).with( + {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus").and_return("request_token") + + request_token = client.request_token( + {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus" + ) + + request_token.should == "request_token" + end + context "Company API" do use_vcr_cassette From 49cb6c499caaed6762613b2acdb9fb756918032b Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Wed, 10 Apr 2013 13:50:05 -0700 Subject: [PATCH 007/117] Fixing broken api_spec due to change in webmock see https://github.com/bblimke/webmock/pull/190 for more info --- linkedin.gemspec | 2 +- spec/cases/api_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linkedin.gemspec b/linkedin.gemspec index 5c45e199..f78fde64 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'rspec', '~> 2.6' gem.add_development_dependency 'simplecov', '~> 0.5' gem.add_development_dependency 'vcr', '~> 1.10' - gem.add_development_dependency 'webmock', '~> 1.7' + gem.add_development_dependency 'webmock', '~> 1.9' gem.authors = ["Wynn Netherland", "Josh Kalderimis"] gem.description = %q{Ruby wrapper for the LinkedIn API} gem.email = ['wynn.netherland@gmail.com', 'josh.kalderimis@gmail.com'] diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index badc2d94..c36ebad4 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -59,7 +59,7 @@ it "should be able to share a new status" do stub_request(:post, "https://api.linkedin.com/v1/people/~/shares").to_return(:body => "", :status => 201) response = client.add_share(:comment => "Testing, 1, 2, 3") - response.body.should == "" + response.body.should == nil response.code.should == "201" end @@ -67,14 +67,14 @@ stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return( :body => "", :status => 201) response = client.update_comment('SOMEKEY', "Testing, 1, 2, 3") - response.body.should == "" + response.body.should == nil response.code.should == "201" end it "should be able to send a message" do stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201) response = client.send_message("subject", "body", ["recip1", "recip2"]) - response.body.should == "" + response.body.should == nil response.code.should == "201" end @@ -136,7 +136,7 @@ stub_request(:put, "https://api.linkedin.com/v1/people/~/group-memberships/123").to_return(:body => "", :status => 201) response = client.join_group(123) - response.body.should == "" + response.body.should == nil response.code.should == "201" end From 4974b451cc862518710d5e8fe213968fd863e7c3 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Wed, 10 Apr 2013 15:18:37 -0700 Subject: [PATCH 008/117] Fixing vcr cassettes by rerunning the api hits: malformed JSON caused errors in 1.8.7 --- spec/cases/search_spec.rb | 72 +++-- .../_search/by_company_name_option.yml | 222 +++++++-------- .../by_first_name_and_last_name_options.yml | 231 +++++++-------- ...name_and_last_name_options_with_fields.yml | 199 +++++++++---- .../_search/by_keywords_string_parameter.yml | 192 +++++-------- .../_search/by_single_keywords_option.yml | 192 +++++-------- ...single_keywords_option_with_pagination.yml | 159 +++-------- .../by_keywords_options_with_fields.yml | 269 ++---------------- .../by_keywords_string_parameter.yml | 211 +++++++++----- .../by_single_keywords_option.yml | 209 ++++++++++---- ...by_single_keywords_option_with_a_facet.yml | 111 -------- ..._keywords_option_with_facets_to_return.yml | 209 ++++++++++---- ...single_keywords_option_with_pagination.yml | 184 ++++++++---- 13 files changed, 1151 insertions(+), 1309 deletions(-) delete mode 100644 spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_a_facet.yml diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 0e31a363..f007c683 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -70,10 +70,10 @@ it "should perform a search" do results.companies.all.size.should == 5 - results.companies.all.first.name.should == 'Apple Vacations' - results.companies.all.first.id.should == 19271 - results.companies.all.last.name.should == 'Micro Center' - results.companies.all.last.id.should == 15552 + results.companies.all.first.name.should == 'iSquare - Apple Authorized Distributor in Greece & Cyprus' + results.companies.all.first.id.should == 2135525 + results.companies.all.last.name.should == 'Apple Crumble' + results.companies.all.last.id.should == 1049054 end end @@ -87,7 +87,7 @@ it "should perform a search" do results.companies.all.first.name.should == 'Apple' - results.companies.all.first.description.should == 'Apple designs Macs, the best personal computers in the world, along with Mac OS X, iLife, iWork, and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple is reinventing the mobile phone with its revolutionary iPhone and App Store, and has recently introduced its magical iPad which is defining the future of mobile media and computing devices.' + results.companies.all.first.description.should == 'Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the mobile phone with its revolutionary iPhone and App Store, and is defining the future of mobile media and computing devices with iPad.' results.companies.all.first.id.should == 162479 end end @@ -104,10 +104,10 @@ end it "should perform a search" do - results.people.all.size.should == 10 - results.people.all.first.first_name.should == 'Giliardi' - results.people.all.first.last_name.should == 'Pires' - results.people.all.first.id.should == 'YkdnFl04s_' + results.people.all.size.should == 6 + results.people.all.first.first_name.should == 'Shay' + results.people.all.first.last_name.should == 'Frendt' + results.people.all.first.id.should == 'ucXjUw4M9J' end end @@ -119,10 +119,10 @@ end it "should perform a search" do - results.people.all.size.should == 10 - results.people.all.first.first_name.should == 'Giliardi' - results.people.all.first.last_name.should == 'Pires' - results.people.all.first.id.should == 'YkdnFl04s_' + results.people.all.size.should == 6 + results.people.all.first.first_name.should == 'Shay' + results.people.all.first.last_name.should == 'Frendt' + results.people.all.first.id.should == 'ucXjUw4M9J' end end @@ -134,13 +134,10 @@ end it "should perform a search" do - results.people.all.size.should == 5 - results.people.all.first.first_name.should == 'Stephen' - results.people.all.first.last_name.should == 'M.' - results.people.all.first.id.should == 'z2XMcxa_dR' - results.people.all.last.first_name.should == 'Pablo' - results.people.all.last.last_name.should == 'C.' - results.people.all.last.id.should == 'pdzrGpyP0h' + results.people.all.size.should == 1 + results.people.all.first.first_name.should == 'Satish' + results.people.all.first.last_name.should == 'Talim' + results.people.all.first.id.should == 'V1FPuGot-I' end end @@ -148,14 +145,14 @@ use_vcr_cassette :record => :new_episodes let(:results) do - client.search(:first_name => 'Giliardi', :last_name => 'Pires') + client.search(:first_name => 'Charles', :last_name => 'Garcia') end it "should perform a search" do - results.people.all.size.should == 1 - results.people.all.first.first_name.should == 'Giliardi' - results.people.all.first.last_name.should == 'Pires' - results.people.all.first.id.should == 'YkdnFl04s_' + results.people.all.size.should == 10 + results.people.all.first.first_name.should == 'Charles' + results.people.all.first.last_name.should == 'Garcia, CFA' + results.people.all.first.id.should == '2zk34r8TvA' end end @@ -164,16 +161,17 @@ let(:results) do fields = [{:people => [:id, :first_name, :last_name, :public_profile_url, :picture_url]}, :num_results] - client.search(:first_name => 'Giliardi', :last_name => 'Pires', :fields => fields) + client.search(:first_name => 'Charles', :last_name => 'Garcia', :fields => fields) end it "should perform a search" do - results.people.all.size.should == 1 - results.people.all.first.first_name.should == 'Giliardi' - results.people.all.first.last_name.should == 'Pires' - results.people.all.first.id.should == 'YkdnFl04s_' - results.people.all.first.picture_url == 'http://media.linkedin.com/mpr/mprx/0_Oz05kn9xkWziAEOUKtOVkqzjXd8Clf7UyqIVkqchR2NtmwZRt1fWoN_aobhg-HmB09jUwPLKrAhU' - results.people.all.first.public_profile_url == 'http://www.linkedin.com/in/gibanet' + first_person = results.people.all.first + results.people.all.size.should == 10 + first_person.first_name.should == 'Charles' + first_person.last_name.should == 'Garcia, CFA' + first_person.id.should == '2zk34r8TvA' + first_person.picture_url.should be_nil + first_person.public_profile_url.should == 'http://www.linkedin.com/in/charlesgarcia' end end @@ -181,14 +179,14 @@ use_vcr_cassette :record => :new_episodes let(:results) do - client.search(:company_name => 'linkedin') + client.search(:company_name => 'IBM') end it "should perform a search" do - results.people.all.size.should == 10 - results.people.all.first.first_name.should == 'Donald' - results.people.all.first.last_name.should == 'Denker' - results.people.all.first.id.should == 'VQcsz5Hp_h' + results.people.all.size.should == 6 + results.people.all.first.first_name.should == 'Ryan' + results.people.all.first.last_name.should == 'Sue' + results.people.all.first.id.should == 'KHkgwBMaa-' end end diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml index 86e69106..dadeef8a 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml @@ -1,135 +1,109 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search?company-name=linkedin body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="5DbPHhxweU6eNBPoAJqkobtxNsZDDIgtmfF0sx3rmQE", oauth_signature="DkRDger8eQvtJq1i8%2FjHzrNAFis%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061368", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="TkuTVt34MgzfuheowxiWtlQzdNdJBfGwh8uNqwcDrS4", oauth_signature="TQsnrPLgwq6hrw4G9VaPwJIKW8o%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: - - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:49 GMT - x-li-format: - - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: + headers: + x-li-request-id: + - 0UF1FY9HHN + vary: + - "*" + transfer-encoding: - chunked - body: ! "{\n \"numResults\": 5228,\n \"people\": {\n \"values\": [\n {\n - \ \"id\": \"VQcsz5Hp_h\",\n \"lastName\": \"Denker\",\n \"firstName\": - \"Donald\"\n },\n {\n \"id\": \"YEDghC612B\",\n \"lastName\": - \"S.\",\n \"firstName\": \"Daniel\"\n },\n {\n \"id\": - \"KMioNXVEg9\",\n \"lastName\": \"H.\",\n \"firstName\": \"Reid\"\n - \ },\n {\n \"id\": \"ILGTOKmto4\",\n \"lastName\": \"Ruff\",\n - \ \"firstName\": \"Lori\"\n },\n {\n \"id\": \"xr5jcMXKPm\",\n - \ \"lastName\": \"C.\",\n \"firstName\": \"Ed\"\n },\n {\n - \ \"id\": \"aeejoSqHsN\",\n \"lastName\": \"T.\",\n \"firstName\": - \"Brian\"\n },\n {\n \"id\": \"VYC0P9hxVN\",\n \"lastName\": - \"Giffen\",\n \"firstName\": \"Sean\"\n },\n {\n \"id\": - \"kWPJPI1lrJ\",\n \"lastName\": \"Seps\",\n \"firstName\": \"Chad\"\n - \ },\n {\n \"id\": \"1PYJr69P5V\",\n \"lastName\": \"Vasconcelos\",\n - \ \"firstName\": \"Cesar\"\n },\n {\n \"id\": \"AU5Dv63Fma\",\n - \ \"lastName\": \"Ling\",\n \"firstName\": \"James\"\n }\n - \ ],\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 110\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="jCUtbvZXpwNVfrj2x0XmxFfQD55R4NoJqVnhgjKEno", - oauth_signature="8XiRWCIiDK%2Fwr%2FTLttRDPnsFaiE%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922227", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:29 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + content-type: + - application/json;charset=UTF-8 + date: + - Wed, 10 Apr 2013 22:07:36 GMT + x-li-format: + - json + body: |- + { + "numResults": 0, + "people": {"_total": 0} + } + http_version: "1.1" +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get - uri: https://api.linkedin.com:443/v1people-search?company-name=linkedin + uri: https://api.linkedin.com:443/v1/people-search?company-name=IBM body: - headers: - x-li-format: + headers: + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="dixy4z5VMylJTypqa3abkuEnVrjFtb5V5hd9DpMKB0", oauth_signature="OOD9beldHTV5d9a6fVpPUqOB%2BPs%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631799", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="5oBn6Ns1YZXUeh0oEmAcCjQrXFhf6c652LEGbFbYe4", - oauth_signature="yHtXFEkeWfhnrsEpDaXn2Epv9KY%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991237", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 404 - message: Not Found - headers: - content-type: - - text/html - content-length: - - '1888' - date: - - Thu, 23 Feb 2012 10:00:38 GMT - server: - - lighttpd - body: ! "\n\n\n - \ 404: Page Not Found\n \n \n\n\n\n\n
\n \"Linkedin\"\n
\n\n
\n

Page Not Found

\n

The page you requested - is no longer available, or cannot be found.

\n

Please - double-check the URL (address) you used, or contact - us if you feel you have reached this page in error.

\n

Click the “Back” button on your browser or go - to the home page.

\n \n
\n \n

Are you looking - for any of these LinkedIn features?

\n \n \n \n\n \n
 
\n
\n\n\n" - http_version: '1.1' + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus + code: 200 + message: OK + headers: + x-li-request-id: + - L00YMW359U + vary: + - "*" + transfer-encoding: + - chunked + server: + - Apache-Coyote/1.1 + date: + - Wed, 10 Apr 2013 22:09:58 GMT + x-li-format: + - json + content-type: + - application/json;charset=UTF-8 + body: |- + { + "numResults": 6, + "people": { + "_total": 6, + "values": [ + { + "firstName": "Ryan", + "id": "KHkgwBMaa-", + "lastName": "Sue" + }, + { + "firstName": "Ben", + "id": "lljISRB-WQ", + "lastName": "Mejia" + }, + { + "firstName": "James", + "id": "zLwxyfa2cv", + "lastName": "Stevenson" + }, + { + "firstName": "Charles", + "id": "r5Kzi9Um-e", + "lastName": "Kafoglis" + }, + { + "firstName": "Sauraj", + "id": "RLJu6NhdI2", + "lastName": "Goswami" + }, + { + "firstName": "Jonathan", + "id": "NgAxaSCyZ3", + "lastName": "Hedstrom" + } + ] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml index 5cd2fedc..16b15099 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml @@ -1,122 +1,131 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search?first-name=Giliardi&last-name=Pires body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="IVMcA0gCXgVmgwAn56FRIpQUdQmyFcoP2RRN6ZzPv4", oauth_signature="8aXd44yIB6fsVy%2BYZJNvR01yp2w%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061364", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: - - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:45 GMT - x-li-format: - - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: + headers: + vary: + - "*" + transfer-encoding: - chunked - body: ! "{\n \"numResults\": 1,\n \"people\": {\n \"values\": [{\n \"id\": - \"YkdnFl04s_\",\n \"lastName\": \"Pires\",\n \"firstName\": \"Giliardi\"\n - \ }],\n \"_total\": 1\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="rXssYvyrlgkdK7ZpsjurbqOPKK3vQ0FUM9pRP37NMc", - oauth_signature="b%2B3nVjLTwMGwAANmULOD8YSdjZU%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922226", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:28 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + x-li-format: + - json + x-li-request-id: + - CH30LTU9DW + date: + - Wed, 10 Apr 2013 22:07:36 GMT + content-type: + - application/json;charset=UTF-8 + body: |- + { + "numResults": 0, + "people": {"_total": 0} + } + http_version: "1.1" +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get - uri: https://api.linkedin.com:443/v1people-search?first-name=Giliardi&last-name=Pires + uri: https://api.linkedin.com:443/v1/people-search?first-name=Charles&last-name=Garcia body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="d90SJkw5a0WbvJqggKUYk02aUMkcPjWLBrfT5lU", - oauth_signature="h9ZKohoAEDStOnt2vQQYoEXdIYk%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991237", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 404 - message: Not Found - headers: - content-type: - - text/html - content-length: - - '1888' - date: - - Thu, 23 Feb 2012 10:00:38 GMT - server: - - lighttpd - body: ! "\n\n\n - \ 404: Page Not Found\n \n \n\n\n\n\n
\n \"Linkedin\"\n
\n\n
\n

Page Not Found

\n

The page you requested - is no longer available, or cannot be found.

\n

Please - double-check the URL (address) you used, or contact - us if you feel you have reached this page in error.

\n

Click the “Back” button on your browser or go - to the home page.

\n \n
\n \n

Are you looking - for any of these LinkedIn features?

\n \n \n \n\n \n
 
\n
\n\n\n" - http_version: '1.1' + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="lTIll68hM4A1tc0I56h92w5znsrjFfJ4nDvKpSqDfg", oauth_signature="AhGLaPTVAJvv8pncUjz2j8C6%2B%2FA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365632102", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus + code: 200 + message: OK + headers: + vary: + - "*" + transfer-encoding: + - chunked + server: + - Apache-Coyote/1.1 + x-li-request-id: + - 6AXWFPE8I6 + x-li-format: + - json + date: + - Wed, 10 Apr 2013 22:15:03 GMT + content-type: + - application/json;charset=UTF-8 + body: |- + { + "numResults": 308, + "people": { + "_count": 10, + "_start": 0, + "_total": 110, + "values": [ + { + "firstName": "Charles", + "id": "2zk34r8TvA", + "lastName": "Garcia, CFA" + }, + { + "firstName": "Charles R.", + "id": "NjwO1vU6P6", + "lastName": "Garcia Jr." + }, + { + "firstName": "Charles", + "id": "j8ZczJo44W", + "lastName": "Garcia-Tobin" + }, + { + "firstName": "Charles", + "id": "jYfrk5GM29", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "C-2ASm3SQ1", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "LG__MFCUTJ", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "wjopxKqYYM", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "AtFQt5Lf1V", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "MUXIZwfehE", + "lastName": "Garcia" + }, + { + "firstName": "Charles", + "id": "koTmAyWE8J", + "lastName": "Schwalbe Garcia-Lago" + } + ] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml index bbd49351..43fbffed 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml @@ -1,72 +1,147 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Giliardi&last-name=Pires body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="p445iIZd1oQn2e1JL6M2ZbGEUi2nTMqacOQ4S1xeDY", oauth_signature="639UhE9asgiYLgUzBYUFrdIF%2BS8%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061366", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XxYZ3yqoTFr792YTu6TmJPFCrrkZejwXkORldtyZGI", oauth_signature="cBkWRwhVxBDozgn5sCXBwGIoer4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: + headers: + server: - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:47 GMT - x-li-format: - - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: + transfer-encoding: - chunked - body: ! "{\n \"numResults\": 1,\n \"people\": {\n \"values\": [{\n \"id\": - \"YkdnFl04s_\",\n \"publicProfileUrl\": \"http://www.linkedin.com/in/gibanet\",\n - \ \"lastName\": \"Pires\",\n \"pictureUrl\": \"http://media.linkedin.com/mpr/mprx/0_Oz05kn9xkWziAEOUKtOVkqzjXd8Clf7UyqIVkqchR2NtmwZRt1fWoN_aobhg-HmB09jUwPLKrAhU\",\n - \ \"firstName\": \"Giliardi\"\n }],\n \"_total\": 1\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken + vary: + - "*" + content-type: + - application/json;charset=UTF-8 + x-li-request-id: + - G0J3Z1XF1E + date: + - Wed, 10 Apr 2013 22:07:36 GMT + x-li-format: + - json + body: |- + { + "numResults": 0, + "people": {"_total": 0} + } + http_version: "1.1" +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request + method: :get + uri: https://api.linkedin.com:443/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Charles&last-name=Garcia body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="bcBcCa4GrHRyxuMfyrnwxQahY2zkrQVUhRhpQDhfA", - oauth_signature="3d%2FocgY%2FpjVNVXL2Ud9aIAWyBCQ%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922227", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + headers: + user-agent: + - OAuth gem v0.4.7 + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="apcqck1ATxZYGou1ynnfBm6OgZFBz4TXKeuPo160NU", oauth_signature="zB0MtadBiOOL2rAX%2FdHn71fZyOA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631934", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + x-li-format: + - json + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus + code: 200 + message: OK + headers: + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:29 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' + transfer-encoding: + - chunked + vary: + - "*" + content-type: + - application/json;charset=UTF-8 + x-li-request-id: + - 7A7TZHN5V9 + date: + - Wed, 10 Apr 2013 22:12:14 GMT + x-li-format: + - json + body: |- + { + "numResults": 308, + "people": { + "_count": 10, + "_start": 0, + "_total": 110, + "values": [ + { + "firstName": "Charles", + "id": "2zk34r8TvA", + "lastName": "Garcia, CFA", + "publicProfileUrl": "http://www.linkedin.com/in/charlesgarcia" + }, + { + "firstName": "Charles R.", + "id": "NjwO1vU6P6", + "lastName": "Garcia Jr.", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_eyd5KukV6r4QDft-oYwsKfzsXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWUUfdKb", + "publicProfileUrl": "http://www.linkedin.com/in/knightwealthmanagement" + }, + { + "firstName": "Charles", + "id": "j8ZczJo44W", + "lastName": "Garcia-Tobin", + "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37" + }, + { + "firstName": "Charles", + "id": "jYfrk5GM29", + "lastName": "Garcia", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m", + "publicProfileUrl": "http://www.linkedin.com/in/charleshgarcia" + }, + { + "firstName": "Charles", + "id": "C-2ASm3SQ1", + "lastName": "Garcia", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib", + "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/26/1b2/b28" + }, + { + "firstName": "Charles", + "id": "LG__MFCUTJ", + "lastName": "Garcia", + "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/5/465/b00" + }, + { + "firstName": "Charles", + "id": "wjopxKqYYM", + "lastName": "Garcia", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb", + "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/8/152/3ab" + }, + { + "firstName": "Charles", + "id": "AtFQt5Lf1V", + "lastName": "Garcia", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq", + "publicProfileUrl": "http://www.linkedin.com/in/chasgarcia" + }, + { + "firstName": "Charles", + "id": "MUXIZwfehE", + "lastName": "Garcia", + "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/14/6a7/81" + }, + { + "firstName": "Charles", + "id": "koTmAyWE8J", + "lastName": "Schwalbe Garcia-Lago", + "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb", + "publicProfileUrl": "http://www.linkedin.com/in/charlesschwalbe" + } + ] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml index e2fb79c9..796feb24 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml @@ -1,136 +1,72 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search?keywords=github body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="KenR6ArkWDl5wqulIJZyecJGRWPE7CEDy9COzkWQXR8", oauth_signature="aPgVcIv2aiTr74Wh3sujsTBD4%2B8%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061358", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="KJPWM7qluIAetEW5kk8NSQuB3ssr1S2v6HBpofhFY", oauth_signature="LEh2O3mlLU6GqhsuU4admW%2B1hDw%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: - - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:40 GMT - x-li-format: + headers: + x-li-request-id: + - L4BQ08FWG8 + x-li-format: - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: - - chunked - body: ! "{\n \"numResults\": 905,\n \"people\": {\n \"values\": [\n {\n - \ \"id\": \"YkdnFl04s_\",\n \"lastName\": \"Pires\",\n \"firstName\": - \"Giliardi\"\n },\n {\n \"id\": \"5oELVyNfN3\",\n \"lastName\": - \"Alencar\",\n \"firstName\": \"Ivan\"\n },\n {\n \"id\": - \"k-wxkgFDYL\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"xT-OdnpncE\",\n \"lastName\": - \"Private\",\n \"firstName\": \"\"\n },\n {\n \"id\": - \"GAG-lE3XVw\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"z2XMcxa_dR\",\n \"lastName\": - \"M.\",\n \"firstName\": \"Stephen\"\n },\n {\n \"id\": - \"cPANxsayPK\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"SbMT09zllx\",\n \"lastName\": - \"L.\",\n \"firstName\": \"Rodolfo\"\n },\n {\n \"id\": - \"GrH-5d4mH1\",\n \"lastName\": \"Barnaba\",\n \"firstName\": - \"Marcello\"\n },\n {\n \"id\": \"pdzrGpyP0h\",\n \"lastName\": - \"C.\",\n \"firstName\": \"Pablo\"\n }\n ],\n \"_count\": - 10,\n \"_start\": 0,\n \"_total\": 110\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="PP414dguMZJe10RlUgLPWaLFhdu8pJ14NoYSKQ36mg", - oauth_signature="utkviYJALT93h%2BJ738IdgmWYQMg%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922222", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + date: + - Wed, 10 Apr 2013 22:07:35 GMT + vary: + - "*" + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:24 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1people-search?keywords=github - body: - headers: - x-li-format: - - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="QLUmDted5J4dGxWyz5TxD2aLeQTSdUYgVF5LqzcaI", - oauth_signature="FQWcB4ad5NTQHoa%2FGiCHrYOnD2M%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991235", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 404 - message: Not Found - headers: - content-type: - - text/html - content-length: - - '1888' - date: - - Thu, 23 Feb 2012 10:00:36 GMT - server: - - lighttpd - body: ! "\n\n\n - \ 404: Page Not Found\n \n \n\n\n\n\n
\n \"Linkedin\"\n
\n\n
\n

Page Not Found

\n

The page you requested - is no longer available, or cannot be found.

\n

Please - double-check the URL (address) you used, or contact - us if you feel you have reached this page in error.

\n

Click the “Back” button on your browser or go - to the home page.

\n \n
\n \n

Are you looking - for any of these LinkedIn features?

\n \n \n \n\n \n
 
\n
\n\n\n" - http_version: '1.1' + content-type: + - application/json;charset=UTF-8 + transfer-encoding: + - chunked + body: |- + { + "numResults": 6, + "people": { + "_total": 6, + "values": [ + { + "firstName": "Shay", + "id": "ucXjUw4M9J", + "lastName": "Frendt" + }, + { + "firstName": "Scott", + "id": "t6mvVsY3df", + "lastName": "Smith" + }, + { + "firstName": "Philip", + "id": "ZeSnXwtz6Y", + "lastName": "Corliss" + }, + { + "firstName": "Jay", + "id": "i24wDA2GrH", + "lastName": "Beavers" + }, + { + "firstName": "Chris", + "id": "SJBelisgHh", + "lastName": "Wiswell" + }, + { + "firstName": "Satish", + "id": "V1FPuGot-I", + "lastName": "Talim" + } + ] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml index b5073847..3eb23203 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml @@ -1,136 +1,72 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search?keywords=github body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="neCS0f9bL8RywiUOvLLDBfAwnc3wmlyFH3N2k4v2PmU", oauth_signature="0EgRN6GvhW3WdWMS8g0gdbOp9Do%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061361", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="DlBgAEJHkDYAnMMZwzFObsUNcCmRbzFldB4dV1yeE", oauth_signature="RLiPr%2FC1bq9Dv29W3mjezy1of54%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: - - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:41 GMT - x-li-format: + headers: + x-li-request-id: + - 5BE8O0G2CK + x-li-format: - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: - - chunked - body: ! "{\n \"numResults\": 905,\n \"people\": {\n \"values\": [\n {\n - \ \"id\": \"YkdnFl04s_\",\n \"lastName\": \"Pires\",\n \"firstName\": - \"Giliardi\"\n },\n {\n \"id\": \"5oELVyNfN3\",\n \"lastName\": - \"Alencar\",\n \"firstName\": \"Ivan\"\n },\n {\n \"id\": - \"k-wxkgFDYL\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"xT-OdnpncE\",\n \"lastName\": - \"Private\",\n \"firstName\": \"\"\n },\n {\n \"id\": - \"GAG-lE3XVw\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"z2XMcxa_dR\",\n \"lastName\": - \"M.\",\n \"firstName\": \"Stephen\"\n },\n {\n \"id\": - \"cPANxsayPK\",\n \"lastName\": \"Private\",\n \"firstName\": - \"\"\n },\n {\n \"id\": \"SbMT09zllx\",\n \"lastName\": - \"L.\",\n \"firstName\": \"Rodolfo\"\n },\n {\n \"id\": - \"GrH-5d4mH1\",\n \"lastName\": \"Barnaba\",\n \"firstName\": - \"Marcello\"\n },\n {\n \"id\": \"pdzrGpyP0h\",\n \"lastName\": - \"C.\",\n \"firstName\": \"Pablo\"\n }\n ],\n \"_count\": - 10,\n \"_start\": 0,\n \"_total\": 110\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="UuoHVjUP4dd5Soqo0WrqODrxeWduE0D7hTTfgqeEgc", - oauth_signature="FLU2BhoUM1I1AwQ5Nv8EtL2O6B8%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922223", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + date: + - Wed, 10 Apr 2013 22:07:35 GMT + vary: + - "*" + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:25 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1people-search?keywords=github - body: - headers: - x-li-format: - - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="Y9Z6mPtiiliebyfkJ6HjTJdPzl1wwoKRDv0eU1Qe6vQ", - oauth_signature="RYpx4iML26Tq5I%2FK14ocPB%2FzOBw%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991236", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 404 - message: Not Found - headers: - content-type: - - text/html - content-length: - - '1888' - date: - - Thu, 23 Feb 2012 10:00:37 GMT - server: - - lighttpd - body: ! "\n\n\n - \ 404: Page Not Found\n \n \n\n\n\n\n
\n \"Linkedin\"\n
\n\n
\n

Page Not Found

\n

The page you requested - is no longer available, or cannot be found.

\n

Please - double-check the URL (address) you used, or contact - us if you feel you have reached this page in error.

\n

Click the “Back” button on your browser or go - to the home page.

\n \n
\n \n

Are you looking - for any of these LinkedIn features?

\n \n \n \n\n \n
 
\n
\n\n\n" - http_version: '1.1' + content-type: + - application/json;charset=UTF-8 + transfer-encoding: + - chunked + body: |- + { + "numResults": 6, + "people": { + "_total": 6, + "values": [ + { + "firstName": "Shay", + "id": "ucXjUw4M9J", + "lastName": "Frendt" + }, + { + "firstName": "Scott", + "id": "t6mvVsY3df", + "lastName": "Smith" + }, + { + "firstName": "Philip", + "id": "ZeSnXwtz6Y", + "lastName": "Corliss" + }, + { + "firstName": "Jay", + "id": "i24wDA2GrH", + "lastName": "Beavers" + }, + { + "firstName": "Chris", + "id": "SJBelisgHh", + "lastName": "Wiswell" + }, + { + "firstName": "Satish", + "id": "V1FPuGot-I", + "lastName": "Talim" + } + ] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml index df0996b6..81c42d88 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml @@ -1,128 +1,47 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/people-search?count=5&keywords=github&start=5 body: - headers: - user-agent: - - OAuth gem v0.4.4 - authorization: - - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn", - oauth_nonce="efW9d0TjHFPkszKWMt55AyyIhu0lf0fqcX5562fL30", oauth_signature="NLhujA9Isu2Y%2FwFRXCpW9oFGip0%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061362", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082", - oauth_version="1.0" - x-li-format: + headers: + x-li-format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="PfrLyLbcfxXAJshwSsQ4YDPBk1OncuNV0RjgB4fbVEs", oauth_signature="16fUd%2BHUkWJULyxMCEbISV0Ltks%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - content-type: - - application/json;charset=UTF-8 - server: - - Apache-Coyote/1.1 - date: - - Tue, 10 May 2011 21:02:44 GMT - x-li-format: + headers: + x-li-request-id: + - JI3L4KN8K1 + x-li-format: - json - vary: - - x-li-format,Accept-Encoding - transfer-encoding: - - chunked - body: ! "{\n \"numResults\": 905,\n \"people\": {\n \"values\": [\n {\n - \ \"id\": \"z2XMcxa_dR\",\n \"lastName\": \"M.\",\n \"firstName\": - \"Stephen\"\n },\n {\n \"id\": \"cPANxsayPK\",\n \"lastName\": - \"Private\",\n \"firstName\": \"\"\n },\n {\n \"id\": - \"SbMT09zllx\",\n \"lastName\": \"L.\",\n \"firstName\": \"Rodolfo\"\n - \ },\n {\n \"id\": \"GrH-5d4mH1\",\n \"lastName\": \"Barnaba\",\n - \ \"firstName\": \"Marcello\"\n },\n {\n \"id\": \"pdzrGpyP0h\",\n - \ \"lastName\": \"C.\",\n \"firstName\": \"Pablo\"\n }\n ],\n - \ \"_count\": 5,\n \"_start\": 5,\n \"_total\": 110\n }\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: - - OAuth gem v0.4.5 - content-length: - - '0' - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="qNNn2PVI87k4RFxKbSolSwOWOlmcxO8bcWrofwTwTqU", - oauth_signature="MhkIBljWjbXfRQ8r4be9jbdDoeo%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329922224", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 401 - message: Unauthorized - headers: - server: + date: + - Wed, 10 Apr 2013 22:07:36 GMT + vary: + - "*" + server: - Apache-Coyote/1.1 - www-authenticate: - - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown" - content-type: - - application/x-www-form-urlencoded;charset=UTF-8 - content-length: - - '34' - vary: - - Accept-Encoding - date: - - Wed, 22 Feb 2012 14:50:28 GMT - body: oauth_problem=consumer_key_unknown - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1people-search?count=5&keywords=github&start=5 - body: - headers: - x-li-format: - - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="T6HlbQmLOSYpKReW5f62ynJ0v5bahq7DPXXtVt8", - oauth_signature="KAO8bptvgvyGmrzuXIcD3oT%2BOPw%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991236", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 404 - message: Not Found - headers: - content-type: - - text/html - content-length: - - '1888' - date: - - Thu, 23 Feb 2012 10:00:37 GMT - server: - - lighttpd - body: ! "\n\n\n - \ 404: Page Not Found\n \n \n\n\n\n\n
\n \"Linkedin\"\n
\n\n
\n

Page Not Found

\n

The page you requested - is no longer available, or cannot be found.

\n

Please - double-check the URL (address) you used, or contact - us if you feel you have reached this page in error.

\n

Click the “Back” button on your browser or go - to the home page.

\n \n
\n \n

Are you looking - for any of these LinkedIn features?

\n \n \n \n\n \n
 
\n
\n\n\n" - http_version: '1.1' + content-type: + - application/json;charset=UTF-8 + transfer-encoding: + - chunked + body: |- + { + "numResults": 6, + "people": { + "_count": 1, + "_start": 5, + "_total": 6, + "values": [{ + "firstName": "Satish", + "id": "V1FPuGot-I", + "lastName": "Talim" + }] + } + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index 5b6c6f6c..dbe58553 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -1,252 +1,35 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/company-search:(companies:(id,name,industries,description,specialties),num-results)?keywords=apple body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="q7OIazxfRqNeuKtIn86PThFXYXwe16NtNQgFe6mETo", - oauth_signature="tBpOJdPV3CvjKM%2Fu3IQ2oS%2BfKvI%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329994002", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XIAUlVH3VfeqacvVEQzCvdLSyy9swruF3mouF9mtc", oauth_signature="ggZObnJ1w5zMIBixfluGoUYZVSg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - HHH4PB27GU - vary: - - ! '*' - x-li-format: + headers: + x-li-request-id: + - 68RH2HSO61 + x-li-format: - json - content-type: + date: + - Wed, 10 Apr 2013 22:07:35 GMT + vary: + - "*" + server: + - Apache-Coyote/1.1 + content-type: - application/json;charset=UTF-8 - transfer-encoding: + transfer-encoding: - chunked - date: - - Thu, 23 Feb 2012 10:46:46 GMT - body: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": - 5696,\n \"values\": [\n {\n \"description\": \"Apple designs - Macs, the best personal computers in the world, along with Mac OS X, iLife, - iWork, and professional software. Apple leads the digital music revolution with - its iPods and iTunes online store. Apple is reinventing the mobile phone with - its revolutionary iPhone and App Store, and has recently introduced its magical - iPad which is defining the future of mobile media and computing devices.\",\n - \ \"id\": 162479,\n \"industries\": {\n \"_total\": 1,\n - \ \"values\": [{\n \"code\": \"4\",\n \"name\": - \"Computer Software\"\n }]\n },\n \"name\": \"Apple\",\n - \ \"specialties\": {\n \"_total\": 4,\n \"values\": - [\n \"Innovative product development\",\n \"world class - operations\",\n \"Retail\",\n \"Telephone Support\"\n - \ ]\n }\n },\n {\n \"description\": \"Every - Apple Retail Store offers customers great ways to get the most out of their - Mac and iPod, such as free advice at the Genius Bar, popular in-store workshops - and special programs for kids. Customers can also book a free appointment with - a Personal Shopper to get expert buying advice or help selecting the perfect - gift for everyone on their list. The hands-on Apple Retail Store experience - gives customers a chance to test-drive Apple\\u2019s entire product line.\",\n - \ \"id\": 1276,\n \"industries\": {\n \"_total\": 1,\n - \ \"values\": [{\n \"code\": \"27\",\n \"name\": - \"Retail\"\n }]\n },\n \"name\": \"Apple Retail\",\n - \ \"specialties\": {\n \"_total\": 3,\n \"values\": - [\n \"retail\",\n \"technology\",\n \"computers\"\n - \ ]\n }\n },\n {\n \"description\": \"Xerox - was founded in 1906 in Rochester, New York as \\\"The Haloid Company\\\", which - originally manufactured photographic paper and equipment. The company subsequently - changed its name to \\\"Haloid Xerox\\\" in 1958 and then simply \\\"Xerox\\\" - in 1961. The company came to prominence in 1959 with the introduction of the - first plain paper photocopier using the process of xerography developed by Chester - Carlson, the Xerox 914. Before releasing the 914, Xerox had also introduced - the first xerographic printer, the \\\"Copyflo\\\" in 1955.\\r\\n\\r\\nIn 1970 - Xerox opened the Xerox PARC research facility. The facility developed many modern - computing methods such as the mouse and the graphical user interface. From these - inventions, Xerox PARC created the Xerox Alto in 1973, a small minicomputer - similar to a workstation and personal computer. The Alto was never commercially - sold, as Xerox itself could not see the sales potential of it. In 1979, several - Apple Computer employees, including Steve Jobs, visited Xerox PARC, interested - in seeing their developments. Jobs and the others saw the commercial potential - of the GUI and mouse, and began development of the Apple Lisa, which Apple introduced - in 1983.\\r\\n \\r\\nHeadquartered in Norwalk, Conn., today Xerox is a $22 - billion leading global enterprise for business process and document management. - Through its portfolio of technology and services, Xerox provides the essential - back-office support that clears the way for clients to focus on what they do - best: their real business. Xerox provides leading-edge document technology, - services, software and genuine Xerox supplies for graphic communication and - office printing environments of any size. Through ACS, A Xerox Company, which - Xerox acquired in February 2010, Xerox also offers extensive business process - outsourcing and IT outsourcing services, including data processing, HR benefits - management, finance support, and CRM services for commercial and government - organizations worldwide.\",\n \"id\": 1373,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": - \"83\",\n \"name\": \"Printing\"\n }]\n },\n \"name\": - \"Xerox\",\n \"specialties\": {\n \"_total\": 6,\n \"values\": - [\n \"Office Solutions\",\n \"Printing\",\n \"document - management\",\n \"managed print services\",\n \"ITO\",\n - \ \"BPO\"\n ]\n }\n },\n {\n \"description\": - \"With more than 23 million members in the United States and Canada, Netflix, - Inc. [Nasdaq: NFLX] is the world\\u2019s leading Internet subscription service - for enjoying movies and TV shows. For $7.99 a month, Netflix members can instantly - watch unlimited movies and TV episodes streamed over the Internet to PCs, Macs - and TVs. Among the large and expanding base of devices streaming from Netflix - are Microsoft\\u2019s Xbox 360, Nintendo\\u2019s Wii and Sony\\u2019s PS3 consoles; - an array of Blu-ray disc players, Internet-connected TVs, home theater systems, - digital video recorders and Internet video players; Apple\\u2019s iPhone, iPad - and iPod touch, as well as Apple TV and Google TV. In all, more than 200 devices - that stream from Netflix are available in the U.S. and a growing number are - available in Canada. For more information, visit www.netflix.com.\",\n \"id\": - 165158,\n \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"28\",\n \"name\": \"Entertainment\"\n - \ }]\n },\n \"name\": \"Netflix\",\n \"specialties\": - {\n \"_total\": 1,\n \"values\": [\"The best way to watch - movies and TV shows instantly.\"]\n }\n },\n {\n \"description\": - \"HCL Infosystems Ltd, with revenue of US $ 2.5 billion (Rs. 12,057 Cr) is India\\u2019s - premier hardware, services and ICT systems integration company offering a wide - \ spectrum of ICT products that includes Computing, Storage, Networking, Security, - Telecom, Imaging and Retail. HCL is a one-stop-shop for all the ICT requirements - of an organization. India's leading System Integration and Infrastructure Management - Services Organization, HCL has specialized expertise across verticals including - Telecom, BFSI, eGovernance & Power. HCL has India's largest distribution and - retail network, taking to market a range of Digital Lifestyle products in partnership - with leading global ICT brands, including Apple, Cisco, Ericsson, Kingston, - Kodak, Konica Minolta, Microsoft, Nokia, and many more. HCL today has India's - largest vertically integrated computer manufacturing facility with over three - decades of electronic manufacturing experience & HCL desktops is the largest - selling brand into the enterprise space. With India\\u2019s largest ICT services - network that reaches to every corner of India, HCL\\u2019s award winning Support - Services makes it the preferred choice of enterprise and consumers alike. HCL - Infosystems has a 100% subsidiary that addresses the physical security technology - system integration market. The subsidiary leverages technology to build a security - framework called \\u2018Safe State\\u2019 that safe guard\\u2019s life, infrastructure - & society. \\r\\nFor more information please visit us at www.hclinfosystems.com\",\n - \ \"id\": 7240,\n \"industries\": {\n \"_total\": 1,\n - \ \"values\": [{\n \"code\": \"96\",\n \"name\": - \"Information Technology and Services\"\n }]\n },\n \"name\": - \"HCL Infosystems Ltd\",\n \"specialties\": {\n \"_total\": - 9,\n \"values\": [\n \"ERP Consulting & Services\",\n \"System - Integration\",\n \"IT Infrastructure Consultancy\",\n \"Managed - Services\",\n \"Strategic Outsourcing Services\",\n \"Infostructure - Services\",\n \"Networking Infrastructure\",\n \"Facilities - Management\",\n \"Career Development Centre and VPN & Managed Network\"\n - \ ]\n }\n },\n {\n \"description\": \"Experience - the Difference. \\r\\nFor over 40 years, Apple Vacations has provided the - most value in vacations to millions of people. Throughout the years, we\\u2019ve - provided what you want in a vacation \\u2013 great service, convenience, and - value. We understand just how important your vacation is. We know because, like - you, vacations are important to us too. \\r\\n \\r\\nApple Vacations is now - a company of almost 1500 energetic, hardworking employees with the same entrepreneurial - attitudes as our founders. Headquartered just outside Philadelphia with regional - offices in Chicago and Boston, the company is completely focused on providing - quality vacations for our customers. Employees are empowered to make decisions - that impact the quality of their customers\\u2019 vacations on a daily basis. - Since our humble beginnings, Apple Vacations has created the ultimate \\u201cbeginning-to-end\\u201d - vacation experience for customers. Apple Vacations employees will greet you - at your departure airport in more than 20 cities; and will meet your flight - in our charter destinations. Apple Vacations\\u2019 sister companies, USA3000 - Airlines, flies customers to their destinations from more than 20 U.S. cities; - and Amstar, is the destination management company in-resort with uniformed representatives, - who will greet you upon arrival and assist you while you are at your resort. - Unlike any other travel company, Apple Vacations truly provides the ultimate - in a quality vacation experience.\",\n \"id\": 19271,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": - \"30\",\n \"name\": \"Leisure and Travel\"\n }]\n },\n - \ \"name\": \"Apple Vacations\",\n \"specialties\": {\n \"_total\": - 2,\n \"values\": [\n \"Leisure travel\",\n \"all - inclusive vacation packages\"\n ]\n }\n },\n {\n \"description\": - \"FileMaker is the leader in easy-to-use database software. Millions of people, - from individuals to some of the world's largest companies, rely on FileMaker - software to manage, analyze and share essential information. \\r\\n\\r\\nThe - company's products are the FileMaker Pro line - versatile database software - for teams and organizations, for Windows, Mac, iPhone, iPad and the web - and - Bento, the personal database for Mac, iPhone and iPad. FileMaker, Inc. is a - subsidiary of Apple.\",\n \"id\": 163801,\n \"industries\": {\n - \ \"_total\": 1,\n \"values\": [{\n \"code\": \"4\",\n - \ \"name\": \"Computer Software\"\n }]\n },\n \"name\": - \"FileMaker\",\n \"specialties\": {\n \"_total\": 10,\n \"values\": - [\n \"database\",\n \"online database\",\n \"easy - database\",\n \"software\",\n \"iphone software\",\n \"iphone - database\",\n \"organization\",\n \"server\",\n \"database - server\",\n \"web database\"\n ]\n }\n },\n - \ {\n \"description\": \"GHA Technologies, Inc. is a nationally expanding - network, computer reseller and systems integrator with offices nationwide. GHA - is listed as the 196 on the national VAR 500 list and 32nd largest private corporation - in Arizona. \\r\\n\\r\\nWe sell Apple, HP, Dell, IBM, Lenovo, Sony, Fujitsu, - APC, Symantec, Panasonic, Microsoft, Vmware, Intel, Cisco, Premio and all the - hottest Internet, bandwidth, security, VoIP, wireless, video, identification - technologies and a vast offering of technology services. \\r\\n\\r\\nSome facts - about GHA Technologies, Inc.\\r\\n\\u2022 One of the largest, private providers - of technology solutions for corporate, government & education markets in America.\\r\\n\\u2022 - Our vast access to coast-to-coast distribution network and warehouse facilities - support just-in-time delivery.\\r\\n\\u2022 Mission-critical delivery-Orders - placed by 9:00 p.m. EST (8:00 p.m. CST) can be received the next morning for - in-stock items.\\r\\n\\u2022 Secure, password-protected 24-hour access to your - own personal, customized website with special pricing on more than 1.1 million - products from more than 1,000 manufacturers.\\r\\n\\r\\nGHA Technologies, Inc. - has about 100 + employees with annual sales of approximately $80 million. Our - highly motivated and experienced sales professionals provide the highest level - of service to our customers. \\r\\n\\r\\nGHA Technologies, Inc. is currently - HIRING industry experienced technology sales professionals nationwide. Please - send your resume to resumes@gha-associates.com. We look forward to hearing from - you.\",\n \"id\": 21482,\n \"industries\": {\n \"_total\": - 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": - \"Information Technology and Services\"\n }]\n },\n \"name\": - \"GHA Technologies\",\n \"specialties\": {\n \"_total\": 5,\n - \ \"values\": [\n \"Hardware, Software and Technology Components\",\n - \ \"Technology Services - Integration, Installation and Specialized\",\n - \ \"Corporate Commercial Business Clients\",\n \"Non-profit - Organizations\",\n \"Government and Educational Institutions\"\n - \ ]\n }\n },\n {\n \"description\": \"Apple - & Associates is an executive search firm that specializes in the Pharmaceutical, - Medical Device and Consumer Product Industries. We provide extensive coverage - of these worldwide markets and have forged a solid reputation in the industry - as a competent, aggressive, and resource-rich recruiting firm. We are a nation-wide - company with offices through-out the United States. \\r\\n\\r\\nApple & Associates - belongs to Intercity Personnel Associates (IPA) and the Top Echelon Network. - \ Through these worldwide recruiting networks, we share confidentially coded - information about available positions and receive qualified candidates within - a short period of time. With one phone call you not only have rapid access - to our candidates, but also to qualified candidates from over 1,000 of the nation\\u2019s - other top recruiting firms. Because our executive recruiters specialize in - different industry segments, we can give you the service you deserve in a fast, - focused, and efficient manner and provide you with quality industry specific - candidates. \\r\\n\\r\\nWe realize the importance of hiring professionals - who understand and are able to assimilate with your company\\u2019s business - model, culture, process, equipment, and materials. Our team has studied the - hiring decisions that make the firms in the Pharmaceutical and Medical Device - industries so successful. Our candidates will meet the standard your company - demands, with the technical and industry background to match.\",\n \"id\": - 112136,\n \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"104\",\n \"name\": \"Staffing and Recruiting\"\n - \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": - {\n \"_total\": 20,\n \"values\": [\n \"Medical - Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n - \ \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n - \ \"Engineering\",\n \"Marketing\",\n \"Sales\",\n - \ \"Human Resources\",\n \"Science\",\n \"Finance\",\n - \ \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n - \ \"Six Sigma\",\n \"IT\",\n \"chemist\",\n - \ \"Executive Management\"\n ]\n }\n },\n {\n - \ \"description\": \"The Ultimate Computer Store - We empower customers - with computer and electronic solutions coupled with excellent customer service - that sets us apart from the rest.\\r\\n\\r\\nFounded in 1979 by two former Radio - Shack employees. The first Micro Center store was a 900 sq ft (84 m2). storefront - located in the Lane Avenue Shopping Center in Upper Arlington, Ohio. There are - currently 22 Micro Center stores nation-wide in California, Colorado, Georgia, - Illinois, Kansas, Massachussetts, Maryland, Michigan, Minnesota, Missouri, New - Jersey, New York, Ohio, Pennsylvania, Texas, and Virginia. A 23rd store will - open in Yonkers, NY this spring.\",\n \"id\": 15552,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": - \"27\",\n \"name\": \"Retail\"\n }]\n },\n \"name\": - \"Micro Center\",\n \"specialties\": {\n \"_total\": 7,\n \"values\": - [\n \"computers\",\n \"Apple\",\n \"build your - own\",\n \"iPod\",\n \"GPS\",\n \"TVs\",\n - \ \"service\"\n ]\n }\n }\n ]\n },\n \"numResults\": - 5696\n}" - http_version: '1.1' + body: "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 8450,\n \"values\": [\n {\n \"description\": \"Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the mobile phone with its revolutionary iPhone and App Store, and is defining the future of mobile media and computing devices with iPad.\",\n \"id\": 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"Apple\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Innovative product development\",\n \"world class operations\",\n \"Retail\",\n \"Telephone Support\"\n ]\n }\n },\n {\n \"description\": \"Experience the Difference. \\r\\nFor over 40 years, Apple Vacations has provided the most value in vacations to millions of people. Throughout the years, we\\u2019ve provided what you want in a vacation \\u2013 great service, convenience, and value. We understand just how important your vacation is. We know because, like you, vacations are important to us too. \\r\\n \\r\\nApple Vacations is a company of energetic, hardworking employees with the same entrepreneurial attitudes as our founders. Headquartered just outside Philadelphia with regional offices in Chicago and Boston, the company is completely focused on providing quality vacations for our customers. Employees are empowered to make decisions that impact the quality of their customers\\u2019 vacations on a daily basis. Since our humble beginnings, Apple Vacations has created the ultimate \\u201cbeginning-to-end\\u201d vacation experience for customers. Apple Vacations employees will greet you at your departure airport in more than 20 cities; and will meet your flight in our charter destinations. Apple Vacations\\u2019 sister companies, flies customers to their destinations from more than 20 U.S. cities; and Amstar, is the destination management company in-resort with uniformed representatives, who will greet you upon arrival and assist you while you are at your resort. Unlike any other travel company, Apple Vacations truly provides the ultimate in a quality vacation experience.\",\n \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"30\",\n \"name\": \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n ]\n }\n },\n {\n \"description\": \"Big Apple International Realty has been listing, selling and managing Residential Real Estate in four counties of the Greater Orlando and Central Florida areas for over five years. Because our Property Management Division had grown substantially, and to fill the growing need for property management services in Central Florida, we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease Only\\\" services at competitive prices, we currently manage close to 50 properties in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n {\n \"description\": \"Apple & Associates is an executive search firm that specializes in the Pharmaceutical, Medical Device and Consumer Product Industries. We provide extensive coverage of these worldwide markets and have forged a solid reputation in the industry as a competent, aggressive, and resource-rich recruiting firm. We are a nation-wide company with offices through-out the United States. \\r\\n\\r\\nApple & Associates belongs to Intercity Personnel Associates (IPA) and the Top Echelon Network. Through these worldwide recruiting networks, we share confidentially coded information about available positions and receive qualified candidates within a short period of time. With one phone call you not only have rapid access to our candidates, but also to qualified candidates from over 1,000 of the nation\\u2019s other top recruiting firms. Because our executive recruiters specialize in different industry segments, we can give you the service you deserve in a fast, focused, and efficient manner and provide you with quality industry specific candidates. \\r\\n\\r\\nWe realize the importance of hiring professionals who understand and are able to assimilate with your company\\u2019s business model, culture, process, equipment, and materials. Our team has studied the hiring decisions that make the firms in the Pharmaceutical and Medical Device industries so successful. Our candidates will meet the standard your company demands, with the technical and industry background to match.\",\n \"id\": 112136,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": {\n \"_total\": 20,\n \"values\": [\n \"Medical Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n \"Engineering\",\n \"Marketing\",\n \"Sales\",\n \"Human Resources\",\n \"Science\",\n \"Finance\",\n \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n \"Six Sigma\",\n \"IT\",\n \"chemist\",\n \"Executive Management\"\n ]\n }\n },\n {\n \"description\": \"Headquartered in Singapore and a presence in 9 countries globally, Stone Apple is a Specialized Consulting firm focused mainly on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge Management & Application Integration with a strong product portfolio, analytical applications, Proprietary Industry Solutions and strong services capability \\r\\n\\r\\nStone Apple has a strong offshore presence in SE Asia with development centers in Vietnam and Malaysia. The Company has a strong presence and networks in Asia Pacific, Europe and United States to support their rapidly growing MNC enterprise customer base \\r\\n\\r\\nStone Apple provides customized solutions to meet the changing needs of enterprises globally. From leading industry methodologies to in-house proven models, Stone Apple collaborates with their customers to deliver tangible business results that impact their bottom line.\",\n \"id\": 772044,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": \"Information Technology & Services\"\n }]\n },\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"description\": \"iSquare S.A. is the Apple Authorised Distributor of Greece and Cyprus since September 2010. iSquare is distributing Apple products but also plans, implements and provides intergrated solutions, based on the innovative Apple products and technology. iSquare's strategic goal is to increase the use of Apple products among the Greek consumers, but also to provide users the ultimate Apple experience.\\r\\n\\r\\niSquare creates and provides a complete ecosystem for Apple products and services, aiming to bring Greek customers closer to Apple's philosophy. In order to do that, iSquare:\\r\\n\\r\\n- Creates a wide network of POS (Points Of Sales) that spreads throughout Greece and Cyprus\\r\\n\\r\\n- Develops its relations with major retail chains in order to promote Apple products to a wide range of customers\\r\\n\\r\\n- Creates a unique network of stores exclusively for Apple products, always in line with the high standards of \\r\\n Apple Premium Reseller program\\r\\n\\r\\n- Invests on continuous and in depth training of the sales network in order to provide the best before and after sale \\r\\n support, according to Apple's and iSquare's high standards\\r\\n\\r\\n- Focuses on the crucial sector of Education\\r\\n\\r\\n- Constantly works to improve the support of Apple products and solutions\\r\\n\\r\\n- Completes Apple's ecosystem as the distributor of software and peripherals from well known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, iSquare aspires to bring the Apple products at the stature they deserve within the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n {\n \"description\": \"Filex (Moj Apple Du\xC4\x87an i Servis) je autorizirani Apple partner za prodaju, servis i podr\xC5\xA1ku.\\r\\n\\r\\nFilex je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapre\xC4\x91ujemo prepoznatljivost Apple tehnologija prezentiraju\xC4\x87i upotrebnu vrijednost Apple rje\xC5\xA1enja, na doma\xC4\x87em i regionalnom tr\xC5\xBEi\xC5\xA1tu.\\r\\n\\r\\nNa\xC5\xA1 fokus nije isklju\xC4\x8Divo na tehnologijama ve\xC4\x87 kako te tehnologije podrediti potrebama korisnika. Sukladno tome, Filex nije samo jo\xC5\xA1 jedna u nizu trgovina u koju \xC4\x87ete do\xC4\x87i \\\"pokupiti\\\" svoj Apple ure\xC4\x91aj, ve\xC4\x87 mjesto na kojem \xC4\x87ete postavljati pitanja, razgovarati i diskutirati te na kraju iza\xC4\x87i sa rje\xC5\xA1enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte nas preko na\xC5\xA1eg Internet Store-a (www.filex.hr), ili nam pi\xC5\xA1ite na prodaja@filx.hr ili servis@filex.hr.\\r\\nI svakako nam se pridru\xC5\xBEite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-Du\xC4\x87an-i-Servis/131194173598671\\r\\n\\r\\nVa\xC5\xA1e zadovoljstvo na\xC5\xA1a je misija!\",\n \"id\": 2303504,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n \"name\": \"Filex Apple Store & Support\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Apple Store\",\n \"Apple Podr\xC5\xA1ka i Servis\",\n \"Apple Rje\xC5\xA1enja\",\n \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over Apple met zorg en proberen u zo goed mogelijk in te lichten als Apple-Fan in Vlaanderen. Dagelijks circuleren er duizenden geruchten over Apple in het algemeen, onze taak is deze te bundelen en u mee te delen.\\r\\n\\r\\nDit doen we met veel liefde voor de verschillende producten en voor Apple in het algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n \"mac\"\n ]\n }\n },\n {\n \"description\": \"OGGO est une soci\xC3\xA9t\xC3\xA9 de conseils et solutions Apple Macintosh bas\xC3\xA9e \xC3\xA0 Gen\xC3\xA8ve, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos services en un coup d'oeil :\\r\\n\\r\\n// R\xC3\xA9parations\\r\\n// Optimisations mat\xC3\xA9rielles\\r\\n// Contrats de maintenance\\r\\n// D\xC3\xA9pannage sur site\\r\\n// Interventions urgentes\\r\\n// Maintenance\\r\\n// Aide \xC3\xA0 l'achat\\r\\n// Formations\",\n \"id\": 2260437,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": \"Information Technology & Services\"\n }]\n },\n \"name\": \"OGGO - Services Apple Macintosh\",\n \"specialties\": {\n \"_total\": 7,\n \"values\": [\n \"Consulting & conseils Apple Macintosh\",\n \"Support Apple Macintosh\",\n \"Maintenance Mac OS X Server\",\n \"D\xC3\xA9pannage Mac OS X\",\n \"Installation Mac OS X Server\",\n \"Interventions Apple Macintosh\",\n \"Formation Apple Macintosh\"\n ]\n }\n },\n {\n \"description\": \"Apple-Crumble provides sound advice, sales and support for all apple mac products and related peripherals including external hard drives, printers, scanners and both apple and 3rd party software. Apple-Crumble are also experts in troubleshooting, repair and maintenance. Our staff are apple trained and certified with over 15 years experience.\\r\\n\\r\\nAll work is guaranteed and all enquiries are welcome.\\r\\n\\r\\nWe are obviously very \\u2018pro\\u2019 apple and firmly believe that once you go mac you never go back!\\r\\n\\r\\nFor your convenience Apple-Crumble have our own workshop and offices with free parking in Penzance, Cornwall so that you have the extra peace of mind knowing that your equipment is being serviced in a clean and safe environment. You may also view, demo and purchase new hardware or add-ons, as well as discussing tailor-made options for you and/or your business.\\r\\n\\r\\nApple-Crumble\\u2019s service extends to on-site visits for emergency or contract call-outs, as well as delivery and installation of new products and systems. We cover Penzance, Falmouth, Helston and the Lizard, St Ives, Hayle, Truro, Camborne, Redruth, and all surrounding areas including north Cornwall and Devon\\r\\n\\r\\nIn most cases it is safer and more cost effective to bring your hardware to us as we are geared up for any static or time delay issues, but it is very rare that we cannot provide a solution, wherever you may be!\",\n \"id\": 1049054,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n },\n \"numResults\": 8450\n\ + }" + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index a046082c..4e27e3e3 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -1,73 +1,156 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/company-search?keywords=apple body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="AjzqbXMKJpWjOwkez3vTKhBzkUwg1hl5oDycGFPqJhU", - oauth_signature="2srg9HlZNRvszkxMALkx%2FNwSFBg%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991290", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="xtc6RIIOpDj7AANJ9VyIXibv4YhcM3gxMUg6OewBSo", oauth_signature="8ShrnvC9fxh1tU3YNEjF4l%2Fhrho%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - LPZS6ZUV2L - vary: - - ! '*' - x-li-format: + headers: + x-li-request-id: + - 5LR8OTP90S + x-li-format: - json - content-type: + date: + - Wed, 10 Apr 2013 22:07:32 GMT + vary: + - "*" + server: + - Apache-Coyote/1.1 + content-type: - application/json;charset=UTF-8 - transfer-encoding: + transfer-encoding: - chunked - date: - - Thu, 23 Feb 2012 10:01:33 GMT - nncoection: - - close - body: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": - 5696,\n \"values\": [\n {\n \"id\": 162479,\n \"name\": - \"Apple\"\n },\n {\n \"id\": 1276,\n \"name\": \"Apple - Retail\"\n },\n {\n \"id\": 1373,\n \"name\": \"Xerox\"\n - \ },\n {\n \"id\": 165158,\n \"name\": \"Netflix\"\n - \ },\n {\n \"id\": 7240,\n \"name\": \"HCL Infosystems - Ltd\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple - Vacations\"\n },\n {\n \"id\": 163801,\n \"name\": \"FileMaker\"\n - \ },\n {\n \"id\": 21482,\n \"name\": \"GHA Technologies\"\n - \ },\n {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 15552,\n \"name\": \"Micro Center\"\n - \ }\n ]\n },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n - \ \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n - \ \"code\": \"us:0\",\n \"count\": 1836,\n \"name\": - \"United States\",\n \"selected\": false\n },\n {\n - \ \"code\": \"gb:0\",\n \"count\": 491,\n \"name\": - \"United Kingdom\",\n \"selected\": false\n },\n {\n - \ \"code\": \"us:84\",\n \"count\": 237,\n \"name\": - \"San Francisco Bay Area\",\n \"selected\": false\n },\n - \ {\n \"code\": \"nl:0\",\n \"count\": 227,\n - \ \"name\": \"Netherlands\",\n \"selected\": false\n },\n - \ {\n \"code\": \"us:70\",\n \"count\": 208,\n - \ \"name\": \"Greater New York City Area\",\n \"selected\": - false\n },\n {\n \"code\": \"ca:0\",\n \"count\": - 199,\n \"name\": \"Canada\",\n \"selected\": false\n },\n - \ {\n \"code\": \"au:0\",\n \"count\": 130,\n - \ \"name\": \"Australia\",\n \"selected\": false\n },\n - \ {\n \"code\": \"us:49\",\n \"count\": 130,\n - \ \"name\": \"Greater Los Angeles Area\",\n \"selected\": - false\n },\n {\n \"code\": \"in:0\",\n \"count\": - 121,\n \"name\": \"India\",\n \"selected\": false\n },\n - \ {\n \"code\": \"it:0\",\n \"count\": 121,\n - \ \"name\": \"Italy\",\n \"selected\": false\n }\n - \ ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n - \ }]\n },\n \"numResults\": 5696\n}" - http_version: '1.1' + body: |- + { + "companies": { + "_count": 10, + "_start": 0, + "_total": 8450, + "values": [ + { + "id": 162479, + "name": "Apple" + }, + { + "id": 19271, + "name": "Apple Vacations" + }, + { + "id": 778626, + "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" + }, + { + "id": 112136, + "name": "Apple & Associates" + }, + { + "id": 772044, + "name": "Stone Apple Solutions" + }, + { + "id": 2135525, + "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" + }, + { + "id": 2303504, + "name": "Filex Apple Store & Support" + }, + { + "id": 2419290, + "name": "Apple Nieuws Vlaanderen" + }, + { + "id": 2260437, + "name": "OGGO - Services Apple Macintosh" + }, + { + "id": 1049054, + "name": "Apple Crumble" + } + ] + }, + "facets": { + "_total": 1, + "values": [{ + "buckets": { + "_total": 10, + "values": [ + { + "code": "us:0", + "count": 2511, + "name": "United States", + "selected": false + }, + { + "code": "gb:0", + "count": 702, + "name": "United Kingdom", + "selected": false + }, + { + "code": "us:84", + "count": 322, + "name": "San Francisco Bay Area", + "selected": false + }, + { + "code": "us:70", + "count": 285, + "name": "Greater New York City Area", + "selected": false + }, + { + "code": "nl:0", + "count": 284, + "name": "Netherlands", + "selected": false + }, + { + "code": "ca:0", + "count": 266, + "name": "Canada", + "selected": false + }, + { + "code": "au:0", + "count": 195, + "name": "Australia", + "selected": false + }, + { + "code": "in:0", + "count": 186, + "name": "India", + "selected": false + }, + { + "code": "it:0", + "count": 177, + "name": "Italy", + "selected": false + }, + { + "code": "us:49", + "count": 173, + "name": "Greater Los Angeles Area", + "selected": false + } + ] + }, + "code": "location", + "name": "Location" + }] + }, + "numResults": 8450 + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index 27ca443c..deafa4f1 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -1,71 +1,156 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/company-search?keywords=apple body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="ejdXp5uWJUyFyQOZKvwjvc3s3ircDxo0qmZPddXOQnQ", - oauth_signature="rUJEgmU4z6mKlIuB5lmkfVbcUYE%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991292", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="8HvACp7Bnl1RHEamMoOAgSExAIsa0ZmPg38voXltI", oauth_signature="vU6TKCCBvu783h%2B0diQLZkcBKb8%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - 3UFS93YLH8 - vary: - - ! '*' - x-li-format: + headers: + x-li-request-id: + - XPJE34FJFO + x-li-format: - json - content-type: + date: + - Wed, 10 Apr 2013 22:07:33 GMT + vary: + - "*" + server: + - Apache-Coyote/1.1 + content-type: - application/json;charset=UTF-8 - transfer-encoding: + transfer-encoding: - chunked - date: - - Thu, 23 Feb 2012 10:01:33 GMT - body: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": - 5696,\n \"values\": [\n {\n \"id\": 162479,\n \"name\": - \"Apple\"\n },\n {\n \"id\": 1276,\n \"name\": \"Apple - Retail\"\n },\n {\n \"id\": 1373,\n \"name\": \"Xerox\"\n - \ },\n {\n \"id\": 165158,\n \"name\": \"Netflix\"\n - \ },\n {\n \"id\": 7240,\n \"name\": \"HCL Infosystems - Ltd\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple - Vacations\"\n },\n {\n \"id\": 163801,\n \"name\": \"FileMaker\"\n - \ },\n {\n \"id\": 21482,\n \"name\": \"GHA Technologies\"\n - \ },\n {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 15552,\n \"name\": \"Micro Center\"\n - \ }\n ]\n },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n - \ \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n - \ \"code\": \"us:0\",\n \"count\": 1836,\n \"name\": - \"United States\",\n \"selected\": false\n },\n {\n - \ \"code\": \"gb:0\",\n \"count\": 491,\n \"name\": - \"United Kingdom\",\n \"selected\": false\n },\n {\n - \ \"code\": \"us:84\",\n \"count\": 237,\n \"name\": - \"San Francisco Bay Area\",\n \"selected\": false\n },\n - \ {\n \"code\": \"nl:0\",\n \"count\": 227,\n - \ \"name\": \"Netherlands\",\n \"selected\": false\n },\n - \ {\n \"code\": \"us:70\",\n \"count\": 208,\n - \ \"name\": \"Greater New York City Area\",\n \"selected\": - false\n },\n {\n \"code\": \"ca:0\",\n \"count\": - 199,\n \"name\": \"Canada\",\n \"selected\": false\n },\n - \ {\n \"code\": \"au:0\",\n \"count\": 130,\n - \ \"name\": \"Australia\",\n \"selected\": false\n },\n - \ {\n \"code\": \"us:49\",\n \"count\": 130,\n - \ \"name\": \"Greater Los Angeles Area\",\n \"selected\": - false\n },\n {\n \"code\": \"in:0\",\n \"count\": - 121,\n \"name\": \"India\",\n \"selected\": false\n },\n - \ {\n \"code\": \"it:0\",\n \"count\": 121,\n - \ \"name\": \"Italy\",\n \"selected\": false\n }\n - \ ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n - \ }]\n },\n \"numResults\": 5696\n}" - http_version: '1.1' + body: |- + { + "companies": { + "_count": 10, + "_start": 0, + "_total": 8450, + "values": [ + { + "id": 162479, + "name": "Apple" + }, + { + "id": 19271, + "name": "Apple Vacations" + }, + { + "id": 778626, + "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" + }, + { + "id": 112136, + "name": "Apple & Associates" + }, + { + "id": 772044, + "name": "Stone Apple Solutions" + }, + { + "id": 2135525, + "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" + }, + { + "id": 2303504, + "name": "Filex Apple Store & Support" + }, + { + "id": 2419290, + "name": "Apple Nieuws Vlaanderen" + }, + { + "id": 2260437, + "name": "OGGO - Services Apple Macintosh" + }, + { + "id": 1049054, + "name": "Apple Crumble" + } + ] + }, + "facets": { + "_total": 1, + "values": [{ + "buckets": { + "_total": 10, + "values": [ + { + "code": "us:0", + "count": 2511, + "name": "United States", + "selected": false + }, + { + "code": "gb:0", + "count": 702, + "name": "United Kingdom", + "selected": false + }, + { + "code": "us:84", + "count": 322, + "name": "San Francisco Bay Area", + "selected": false + }, + { + "code": "us:70", + "count": 285, + "name": "Greater New York City Area", + "selected": false + }, + { + "code": "nl:0", + "count": 284, + "name": "Netherlands", + "selected": false + }, + { + "code": "ca:0", + "count": 266, + "name": "Canada", + "selected": false + }, + { + "code": "au:0", + "count": 195, + "name": "Australia", + "selected": false + }, + { + "code": "in:0", + "count": 186, + "name": "India", + "selected": false + }, + { + "code": "it:0", + "count": 177, + "name": "Italy", + "selected": false + }, + { + "code": "us:49", + "count": 173, + "name": "Greater Los Angeles Area", + "selected": false + } + ] + }, + "code": "location", + "name": "Location" + }] + }, + "numResults": 8450 + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_a_facet.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_a_facet.yml deleted file mode 100644 index 0f47541b..00000000 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_a_facet.yml +++ /dev/null @@ -1,111 +0,0 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?facets=industry%20location&keywords=apple - body: - headers: - x-li-format: - - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="xcTeuTk5cLV7tNNj54FHtRznawbANOaFufpxhOzMoo", - oauth_signature="JoirhKilAS83lfN9j27EccA5EBw%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991294", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 400 - message: Bad Request - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - KK2E56GW6H - date: - - Thu, 23 Feb 2012 10:01:34 GMT - vary: - - ! '*' - x-li-format: - - json - content-type: - - application/json;charset=UTF-8 - content-length: - - '151' - nncoection: - - close - body: ! "{\n \"errorCode\": 0,\n \"message\": \"Unknown facet code {industry - location}\",\n \"requestId\": \"KK2E56GW6H\",\n \"status\": 400,\n \"timestamp\": - 1329991295101\n}" - http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?facets=industry&keywords=apple - body: - headers: - x-li-format: - - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="irnhySxSqqJGyvqrhpTSLcNDzNZRjJlwEje7dkhgvg", - oauth_signature="5giHjjs15I5NzMA%2FEYoPejTl4BI%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991354", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus - code: 200 - message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - 0VNTJU19QA - vary: - - ! '*' - x-li-format: - - json - content-type: - - application/json;charset=UTF-8 - transfer-encoding: - - chunked - date: - - Thu, 23 Feb 2012 10:02:36 GMT - body: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": - 5696,\n \"values\": [\n {\n \"id\": 162479,\n \"name\": - \"Apple\"\n },\n {\n \"id\": 1276,\n \"name\": \"Apple - Retail\"\n },\n {\n \"id\": 1373,\n \"name\": \"Xerox\"\n - \ },\n {\n \"id\": 165158,\n \"name\": \"Netflix\"\n - \ },\n {\n \"id\": 7240,\n \"name\": \"HCL Infosystems - Ltd\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple - Vacations\"\n },\n {\n \"id\": 163801,\n \"name\": \"FileMaker\"\n - \ },\n {\n \"id\": 21482,\n \"name\": \"GHA Technologies\"\n - \ },\n {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 15552,\n \"name\": \"Micro Center\"\n - \ }\n ]\n },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n - \ \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n - \ \"code\": \"96\",\n \"count\": 1386,\n \"name\": - \"Information Technology and Services\",\n \"selected\": false\n - \ },\n {\n \"code\": \"4\",\n \"count\": - 732,\n \"name\": \"Computer Software\",\n \"selected\": - false\n },\n {\n \"code\": \"3\",\n \"count\": - 313,\n \"name\": \"Computer Hardware\",\n \"selected\": - false\n },\n {\n \"code\": \"6\",\n \"count\": - 295,\n \"name\": \"Internet\",\n \"selected\": false\n - \ },\n {\n \"code\": \"80\",\n \"count\": - 219,\n \"name\": \"Marketing and Advertising\",\n \"selected\": - false\n },\n {\n \"code\": \"24\",\n \"count\": - 166,\n \"name\": \"Consumer Electronics\",\n \"selected\": - false\n },\n {\n \"code\": \"27\",\n \"count\": - 142,\n \"name\": \"Retail\",\n \"selected\": false\n },\n - \ {\n \"code\": \"109\",\n \"count\": 123,\n \"name\": - \"Computer Games\",\n \"selected\": false\n },\n {\n - \ \"code\": \"126\",\n \"count\": 120,\n \"name\": - \"Media Production\",\n \"selected\": false\n },\n {\n - \ \"code\": \"99\",\n \"count\": 117,\n \"name\": - \"Design\",\n \"selected\": false\n }\n ]\n },\n - \ \"code\": \"industry\",\n \"name\": \"Industry\"\n }]\n },\n - \ \"numResults\": 5696\n}" - http_version: '1.1' diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index 2390a37d..e4fa5418 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -1,71 +1,156 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/company-search?facets=industry&keywords=apple body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="WNtBym5LDMHmF1yNiZA8ypTi6Ae5yZFgfWeyYjVK0E8", - oauth_signature="x2Mh3MmxuXDz2sBMnlqNsXIub5I%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329991802", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="FU07WVy5LyepRG8O99eNUI0fqIxdghVO9gXhSQAOA", oauth_signature="51O%2BsP4hpjq93vwrFm2zrox0xfI%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - 4MRGJTY83T - vary: - - ! '*' - x-li-format: + headers: + x-li-request-id: + - G21FIZ5M8V + x-li-format: - json - content-type: + date: + - Wed, 10 Apr 2013 22:07:33 GMT + vary: + - "*" + server: + - Apache-Coyote/1.1 + content-type: - application/json;charset=UTF-8 - transfer-encoding: + transfer-encoding: - chunked - date: - - Thu, 23 Feb 2012 10:10:03 GMT - body: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": - 5696,\n \"values\": [\n {\n \"id\": 162479,\n \"name\": - \"Apple\"\n },\n {\n \"id\": 1276,\n \"name\": \"Apple - Retail\"\n },\n {\n \"id\": 1373,\n \"name\": \"Xerox\"\n - \ },\n {\n \"id\": 165158,\n \"name\": \"Netflix\"\n - \ },\n {\n \"id\": 7240,\n \"name\": \"HCL Infosystems - Ltd\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple - Vacations\"\n },\n {\n \"id\": 163801,\n \"name\": \"FileMaker\"\n - \ },\n {\n \"id\": 21482,\n \"name\": \"GHA Technologies\"\n - \ },\n {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 15552,\n \"name\": \"Micro Center\"\n - \ }\n ]\n },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n - \ \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n - \ \"code\": \"96\",\n \"count\": 1386,\n \"name\": - \"Information Technology and Services\",\n \"selected\": false\n - \ },\n {\n \"code\": \"4\",\n \"count\": - 732,\n \"name\": \"Computer Software\",\n \"selected\": - false\n },\n {\n \"code\": \"3\",\n \"count\": - 313,\n \"name\": \"Computer Hardware\",\n \"selected\": - false\n },\n {\n \"code\": \"6\",\n \"count\": - 295,\n \"name\": \"Internet\",\n \"selected\": false\n - \ },\n {\n \"code\": \"80\",\n \"count\": - 219,\n \"name\": \"Marketing and Advertising\",\n \"selected\": - false\n },\n {\n \"code\": \"24\",\n \"count\": - 166,\n \"name\": \"Consumer Electronics\",\n \"selected\": - false\n },\n {\n \"code\": \"27\",\n \"count\": - 142,\n \"name\": \"Retail\",\n \"selected\": false\n },\n - \ {\n \"code\": \"109\",\n \"count\": 123,\n \"name\": - \"Computer Games\",\n \"selected\": false\n },\n {\n - \ \"code\": \"126\",\n \"count\": 120,\n \"name\": - \"Media Production\",\n \"selected\": false\n },\n {\n - \ \"code\": \"99\",\n \"count\": 117,\n \"name\": - \"Design\",\n \"selected\": false\n }\n ]\n },\n - \ \"code\": \"industry\",\n \"name\": \"Industry\"\n }]\n },\n - \ \"numResults\": 5696\n}" - http_version: '1.1' + body: |- + { + "companies": { + "_count": 10, + "_start": 0, + "_total": 8450, + "values": [ + { + "id": 162479, + "name": "Apple" + }, + { + "id": 19271, + "name": "Apple Vacations" + }, + { + "id": 778626, + "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" + }, + { + "id": 112136, + "name": "Apple & Associates" + }, + { + "id": 772044, + "name": "Stone Apple Solutions" + }, + { + "id": 2135525, + "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" + }, + { + "id": 2303504, + "name": "Filex Apple Store & Support" + }, + { + "id": 2419290, + "name": "Apple Nieuws Vlaanderen" + }, + { + "id": 2260437, + "name": "OGGO - Services Apple Macintosh" + }, + { + "id": 1049054, + "name": "Apple Crumble" + } + ] + }, + "facets": { + "_total": 1, + "values": [{ + "buckets": { + "_total": 10, + "values": [ + { + "code": "96", + "count": 2062, + "name": "Information Technology and Services", + "selected": false + }, + { + "code": "4", + "count": 1031, + "name": "Computer Software", + "selected": false + }, + { + "code": "6", + "count": 472, + "name": "Internet", + "selected": false + }, + { + "code": "3", + "count": 415, + "name": "Computer Hardware", + "selected": false + }, + { + "code": "80", + "count": 348, + "name": "Marketing and Advertising", + "selected": false + }, + { + "code": "24", + "count": 312, + "name": "Consumer Electronics", + "selected": false + }, + { + "code": "27", + "count": 206, + "name": "Retail", + "selected": false + }, + { + "code": "109", + "count": 185, + "name": "Computer Games", + "selected": false + }, + { + "code": "8", + "count": 171, + "name": "Telecommunications", + "selected": false + }, + { + "code": "126", + "count": 164, + "name": "Media Production", + "selected": false + } + ] + }, + "code": "industry", + "name": "Industry" + }] + }, + "numResults": 8450 + } + http_version: "1.1" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index c2f85de1..dd4ca251 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -1,66 +1,136 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +- !ruby/struct:VCR::HTTPInteraction + request: !ruby/struct:VCR::Request method: :get uri: https://api.linkedin.com:443/v1/company-search?count=5&keywords=apple&start=5 body: - headers: - x-li-format: + headers: + x-li-format: - json - user-agent: - - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="ijlM2rk0lIDFQSvHgwegzYK3BlzbB4bywFyygdPsJA", - oauth_signature="roxP%2BA3I%2F8PlBub%2B%2BqSF%2FBp3EqU%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1329992230", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9", - oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="UCRIU2SBembgaUTMw9aBAK0tCDnDuxPG4GzClCmcVQ", oauth_signature="46tFOgfxDKiVNID1XIHrpoAs7zA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" + user-agent: + - OAuth gem v0.4.7 + response: !ruby/struct:VCR::Response + status: !ruby/struct:VCR::ResponseStatus code: 200 message: OK - headers: - server: - - Apache-Coyote/1.1 - x-li-request-id: - - 7Y7WOBATID - vary: - - ! '*' - x-li-format: + headers: + x-li-request-id: + - YMZX3QW2A1 + x-li-format: - json - content-type: + date: + - Wed, 10 Apr 2013 22:07:33 GMT + vary: + - "*" + server: + - Apache-Coyote/1.1 + content-type: - application/json;charset=UTF-8 - transfer-encoding: + transfer-encoding: - chunked - date: - - Thu, 23 Feb 2012 10:17:13 GMT - body: ! "{\n \"companies\": {\n \"_count\": 5,\n \"_start\": 5,\n \"_total\": - 5696,\n \"values\": [\n {\n \"id\": 19271,\n \"name\": - \"Apple Vacations\"\n },\n {\n \"id\": 163801,\n \"name\": - \"FileMaker\"\n },\n {\n \"id\": 21482,\n \"name\": - \"GHA Technologies\"\n },\n {\n \"id\": 112136,\n \"name\": - \"Apple & Associates\"\n },\n {\n \"id\": 15552,\n \"name\": - \"Micro Center\"\n }\n ]\n },\n \"facets\": {\n \"_total\": 1,\n - \ \"values\": [{\n \"buckets\": {\n \"_total\": 10,\n \"values\": - [\n {\n \"code\": \"us:0\",\n \"count\": 1836,\n - \ \"name\": \"United States\",\n \"selected\": false\n - \ },\n {\n \"code\": \"gb:0\",\n \"count\": - 491,\n \"name\": \"United Kingdom\",\n \"selected\": false\n - \ },\n {\n \"code\": \"us:84\",\n \"count\": - 237,\n \"name\": \"San Francisco Bay Area\",\n \"selected\": - false\n },\n {\n \"code\": \"nl:0\",\n \"count\": - 227,\n \"name\": \"Netherlands\",\n \"selected\": false\n - \ },\n {\n \"code\": \"us:70\",\n \"count\": - 208,\n \"name\": \"Greater New York City Area\",\n \"selected\": - false\n },\n {\n \"code\": \"ca:0\",\n \"count\": - 199,\n \"name\": \"Canada\",\n \"selected\": false\n },\n - \ {\n \"code\": \"au:0\",\n \"count\": 130,\n - \ \"name\": \"Australia\",\n \"selected\": false\n },\n - \ {\n \"code\": \"us:49\",\n \"count\": 130,\n - \ \"name\": \"Greater Los Angeles Area\",\n \"selected\": - false\n },\n {\n \"code\": \"in:0\",\n \"count\": - 121,\n \"name\": \"India\",\n \"selected\": false\n },\n - \ {\n \"code\": \"it:0\",\n \"count\": 121,\n - \ \"name\": \"Italy\",\n \"selected\": false\n }\n - \ ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n - \ }]\n },\n \"numResults\": 5696\n}" - http_version: '1.1' + body: |- + { + "companies": { + "_count": 5, + "_start": 5, + "_total": 8450, + "values": [ + { + "id": 2135525, + "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" + }, + { + "id": 2303504, + "name": "Filex Apple Store & Support" + }, + { + "id": 2419290, + "name": "Apple Nieuws Vlaanderen" + }, + { + "id": 2260437, + "name": "OGGO - Services Apple Macintosh" + }, + { + "id": 1049054, + "name": "Apple Crumble" + } + ] + }, + "facets": { + "_total": 1, + "values": [{ + "buckets": { + "_total": 10, + "values": [ + { + "code": "us:0", + "count": 2511, + "name": "United States", + "selected": false + }, + { + "code": "gb:0", + "count": 702, + "name": "United Kingdom", + "selected": false + }, + { + "code": "us:84", + "count": 322, + "name": "San Francisco Bay Area", + "selected": false + }, + { + "code": "us:70", + "count": 285, + "name": "Greater New York City Area", + "selected": false + }, + { + "code": "nl:0", + "count": 284, + "name": "Netherlands", + "selected": false + }, + { + "code": "ca:0", + "count": 266, + "name": "Canada", + "selected": false + }, + { + "code": "au:0", + "count": 195, + "name": "Australia", + "selected": false + }, + { + "code": "in:0", + "count": 186, + "name": "India", + "selected": false + }, + { + "code": "it:0", + "count": 177, + "name": "Italy", + "selected": false + }, + { + "code": "us:49", + "count": 173, + "name": "Greater Los Angeles Area", + "selected": false + } + ] + }, + "code": "location", + "name": "Location" + }] + }, + "numResults": 8450 + } + http_version: "1.1" From c3bdee2112ab08e89929685d17d48dd27ee271bf Mon Sep 17 00:00:00 2001 From: Josh Jordan Date: Wed, 1 May 2013 18:23:02 -0400 Subject: [PATCH 009/117] Bump hashie version --- linkedin.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkedin.gemspec b/linkedin.gemspec index f78fde64..1cb929bc 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -2,7 +2,7 @@ require File.expand_path('../lib/linked_in/version', __FILE__) Gem::Specification.new do |gem| - gem.add_dependency 'hashie', '~> 1.2' + gem.add_dependency 'hashie', ['>= 1.2', '< 2.1'] gem.add_dependency 'multi_json', '~> 1.0' gem.add_dependency 'oauth', '~> 0.4' gem.add_development_dependency 'json', '~> 1.6' From 3ccc71233e2eb23eb7997d44b0b23844490110a7 Mon Sep 17 00:00:00 2001 From: Alexander Paramonov Date: Mon, 20 May 2013 14:36:20 +0300 Subject: [PATCH 010/117] Add option to specify a proxy --- lib/linked_in/helpers/authorization.rb | 3 ++- spec/cases/oauth_spec.rb | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/linked_in/helpers/authorization.rb b/lib/linked_in/helpers/authorization.rb index c691c9e8..29554b6e 100644 --- a/lib/linked_in/helpers/authorization.rb +++ b/lib/linked_in/helpers/authorization.rb @@ -48,7 +48,8 @@ def parse_oauth_options :request_token_url => full_oauth_url_for(:request_token, :api_host), :access_token_url => full_oauth_url_for(:access_token, :api_host), :authorize_url => full_oauth_url_for(:authorize, :auth_host), - :site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host] + :site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host], + :proxy => @consumer_options.fetch(:proxy, nil) } end diff --git a/spec/cases/oauth_spec.rb b/spec/cases/oauth_spec.rb index 07c7792e..bb9f38eb 100644 --- a/spec/cases/oauth_spec.rb +++ b/spec/cases/oauth_spec.rb @@ -20,6 +20,19 @@ end end + describe "proxy oauth options" do + let(:proxy) { "http://dummy.proxy" } + let(:consumer) do + LinkedIn::Client.new('1234', '1234', { + :proxy => proxy, + }).consumer + end + + it "should send requests though proxy" do + consumer.proxy.should eq proxy + end + end + describe "different api and auth hosts options" do let(:consumer) do LinkedIn::Client.new('1234', '1234', { From 86d3f55f2a07982b1b564f10de1b4d320452c9d1 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 May 2013 14:26:19 -0700 Subject: [PATCH 011/117] Bump to Version 0.4.0, Changes since 0.3.7: * Add capability to ask for desired permissions from linked in api * Add option to specify a proxy * Bump hashie version * fix the permission param passing * fix to be able to pass the permission scope * Manipulating comments/likes for network_updates ('shares') * Methods to work with comments/likes for share * Added a method to get a user's shares * Added current user's shares as an option (client.shares) * Readme Typos ') --- lib/linked_in/version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index de2a34be..7d5d6ae4 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -2,8 +2,8 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 - MINOR = 3 - PATCH = 7 + MINOR = 4 + PATCH = 0 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From 3227a238f7bbef3571dd3646e154e1cba6f4e14f Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 May 2013 14:28:19 -0700 Subject: [PATCH 012/117] Adding 0.4.0 to changelog --- changelog.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/changelog.markdown b/changelog.markdown index 5177d5fc..75bb3582 100644 --- a/changelog.markdown +++ b/changelog.markdown @@ -1,5 +1,20 @@ # Changelog +## 0.4.0 - May 30, 2013 + +* Add capability to ask for desired permissions from linked in api +* Add option to specify a proxy +* Bump hashie version +* fix the permission param passing +* fix to be able to pass the permission scope +* Manipulating comments/likes for network_updates ('shares') +* Methods to work with comments/likes for share +* Added a method to get a user's shares +* Added current user's shares as an option (client.shares) +* Readme Typos + + + ## 0.2.x - March x, 2010 * Removed Crack as a dependency, Nokogiri FTW From d288cc455fd44157ae55dca850aa5220aa8f0eb2 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 3 Jun 2013 20:34:42 -0700 Subject: [PATCH 013/117] Fixing e-mail domain filtering issue brought up in PR #101 --- lib/linked_in/api/query_methods.rb | 17 +++++++++-------- spec/cases/api_spec.rb | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 5631b93f..cba9dd19 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -73,17 +73,18 @@ def person_path(options) end def company_path(options) - path = "/companies/" - if id = options.delete(:id) - path += "id=#{id}" + path = "/companies" + + if domain = options.delete(:domain) + path += "?email-domain=#{CGI.escape(domain)}" + elsif id = options.delete(:id) + path += "/id=#{id}" elsif url = options.delete(:url) - path += "url=#{CGI.escape(url)}" + path += "/url=#{CGI.escape(url)}" elsif name = options.delete(:name) - path += "universal-name=#{CGI.escape(name)}" - elsif domain = options.delete(:domain) - path += "email-domain=#{CGI.escape(domain)}" + path += "/universal-name=#{CGI.escape(name)}" else - path += "~" + path += "/~" end end diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 2bc80166..f031aa11 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -119,7 +119,7 @@ end it "should be able to view a company by e-mail domain" do - stub_request(:get, "https://api.linkedin.com/v1/companies/email-domain=acme.com").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies?email-domain=acme.com").to_return(:body => "{}") client.company(:domain => 'acme.com').should be_an_instance_of(LinkedIn::Mash) end From e001bf57b0176f504e8e2ca4a7a6a3a695d9ff5e Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 3 Jun 2013 20:51:11 -0700 Subject: [PATCH 014/117] Sanitizing query parameter building --- lib/linked_in/api/query_methods.rb | 6 +++--- lib/linked_in/helpers/request.rb | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index cba9dd19..6ed21908 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -27,7 +27,7 @@ def group_memberships(options = {}) path = "#{person_path(options)}/group-memberships" simple_query(path, options) end - + def shares(options={}) path = "#{person_path(options)}/network/updates?type=SHAR&scope=self" simple_query(path, options) @@ -55,8 +55,8 @@ def simple_query(path, options={}) end headers = options.delete(:headers) || {} - params = options.map { |k,v| "#{k}=#{v}" }.join("&") - path += "?#{params}" if not params.empty? + params = to_query(options) + path += "?#{params}" if !params.empty? Mash.from_json(get(path, headers)) end diff --git a/lib/linked_in/helpers/request.rb b/lib/linked_in/helpers/request.rb index 99f1b86c..0cdeaaf4 100644 --- a/lib/linked_in/helpers/request.rb +++ b/lib/linked_in/helpers/request.rb @@ -59,11 +59,16 @@ def raise_errors(response) end end - def to_query(options) - options.inject([]) do |collection, opt| - collection << "#{opt[0]}=#{opt[1]}" - collection - end * '&' + + # Stolen from Rack::Util.build_query + def to_query(params) + params.map { |k, v| + if v.class == Array + build_query(v.map { |x| [k, x] }) + else + v.nil? ? escape(k) : "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" + end + }.join("&") end def to_uri(path, options) From b044a3465a9c2782dc81c3733fd8f618311b1eb9 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 3 Jun 2013 21:00:17 -0700 Subject: [PATCH 015/117] Updating the status example --- examples/status.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/status.rb b/examples/status.rb index d23ebe5a..457ebe4a 100644 --- a/examples/status.rb +++ b/examples/status.rb @@ -3,7 +3,4 @@ # client is a LinkedIn::Client # update status for the authenticated user -client.update_status('is playing with the LinkedIn Ruby gem') - -# clear status for the currently logged in user -client.clear_status +client.add_share(:comment => 'is playing with the LinkedIn Ruby gem') From dd64adb122799e50762a9bdcc4c23b820dc061dc Mon Sep 17 00:00:00 2001 From: Antek Drzewiecki Date: Thu, 6 Jun 2013 19:53:01 +0200 Subject: [PATCH 016/117] Implemented the Job API, view job, view user bookmarks, add user bookmark and view job suggestions. --- lib/linked_in/api/query_methods.rb | 24 ++++++++++++++++++++++++ lib/linked_in/api/update_methods.rb | 6 ++++++ spec/cases/api_spec.rb | 26 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 6ed21908..b318e1c0 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -23,6 +23,21 @@ def company(options = {}) simple_query(path, options) end + def job(options = {}) + path = jobs_path(options) + simple_query(path, options) + end + + def job_bookmarks(options = {}) + path = "#{person_path(options)}/job-bookmarks" + simple_query(path, options) + end + + def job_suggestions(options = {}) + path = "#{person_path(options)}/suggestions/job-suggestions" + simple_query(path, options) + end + def group_memberships(options = {}) path = "#{person_path(options)}/group-memberships" simple_query(path, options) @@ -88,6 +103,15 @@ def company_path(options) end end + def jobs_path(options) + path = "/jobs" + if id = options.delete(:id) + path += "/id=#{id}" + else + path += "/~" + end + end + end end diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 396b69f9..cbf3b96b 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -15,6 +15,12 @@ def join_group(group_id) put(path, body.to_json, "Content-Type" => "application/json") end + def add_job_bookmark(bookmark) + path = "/people/~/job-bookmarks" + body = {'job' => {'id' => bookmark}} + post(path, body.to_json, "Content-Type" => "application/json") + end + # def share(options={}) # path = "/people/~/shares" # defaults = { :visability => 'anyone' } diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index f031aa11..cce90346 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -136,6 +136,32 @@ end end + context "Job API" do + use_vcr_cassette + + it "should be able to view a job listing" do + stub_request(:get, "https://api.linkedin.com/v1/jobs/id=1586").to_return(:body => "{}") + client.job(:id => 1586).should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view its job bookmarks" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/job-bookmarks").to_return(:body => "{}") + client.job_bookmarks.should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view its job suggestion" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/suggestions/job-suggestions").to_return(:body => "{}") + client.job_suggestions.should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to add a bookmark" do + stub_request(:post, "https://api.linkedin.com/v1/people/~/job-bookmarks").to_return(:body => "", :status => 201) + response = client.add_job_bookmark(:id => 1452577) + response.body.should == nil + response.code.should == "201" + end + end + context "Group API" do it "should be able to list group memberships for a profile" do From 4e010db549d52c742a1180d98125707f4af6fbb1 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 6 Jun 2013 12:04:52 -0700 Subject: [PATCH 017/117] Fixing possible bug from array key value pairs --- lib/linked_in/helpers/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/helpers/request.rb b/lib/linked_in/helpers/request.rb index 0cdeaaf4..94f66592 100644 --- a/lib/linked_in/helpers/request.rb +++ b/lib/linked_in/helpers/request.rb @@ -64,7 +64,7 @@ def raise_errors(response) def to_query(params) params.map { |k, v| if v.class == Array - build_query(v.map { |x| [k, x] }) + to_query(v.map { |x| [k, x] }) else v.nil? ? escape(k) : "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" end From f8d3315f19ad1afea68ad774b8d0c6c8b2119530 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 6 Jun 2013 12:08:49 -0700 Subject: [PATCH 018/117] Bumping from 0.4.0 to 0.4.1: * Fixing E-mail filtering issue brought up in PR#101 * Sanitizing query parameter building * Updated examples * Implemented Job API --- lib/linked_in/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 7d5d6ae4..416659c0 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -3,7 +3,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 MINOR = 4 - PATCH = 0 + PATCH = 1 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From c352ef64b58ba364c41bcf5d3b3e939f53773400 Mon Sep 17 00:00:00 2001 From: Eduardo Gurgel Date: Tue, 11 Jun 2013 09:46:01 -0300 Subject: [PATCH 019/117] Add syntax highlighting to ruby code on README --- README.markdown | 50 +++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README.markdown b/README.markdown index 4a8cc455..e6edd37d 100644 --- a/README.markdown +++ b/README.markdown @@ -14,39 +14,41 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/pengwynn/linkedin.png) LinkedIn's API uses Oauth for authentication. Luckily, the LinkedIn gem hides most of the gory details from you. - require 'rubygems' - require 'linkedin' +```ruby +require 'rubygems' +require 'linkedin' - # get your api keys at https://www.linkedin.com/secure/developer - client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') - rtoken = client.request_token.token - rsecret = client.request_token.secret +# get your api keys at https://www.linkedin.com/secure/developer +client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') +rtoken = client.request_token.token +rsecret = client.request_token.secret - # to test from your desktop, open the following url in your browser - # and record the pin it gives you - client.request_token.authorize_url - => "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" +# to test from your desktop, open the following url in your browser +# and record the pin it gives you +client.request_token.authorize_url +=> "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" - # then fetch your access keys - client.authorize_from_request(rtoken, rsecret, pin) - => ["OU812", "8675309"] # <= save these for future requests +# then fetch your access keys +client.authorize_from_request(rtoken, rsecret, pin) +=> ["OU812", "8675309"] # <= save these for future requests - # or authorize from previously fetched access keys - client.authorize_from_access("OU812", "8675309") +# or authorize from previously fetched access keys +client.authorize_from_access("OU812", "8675309") - # you're now free to move about the cabin, call any API method +# you're now free to move about the cabin, call any API method +``` ### Profile examples +```ruby +# get the profile for the authenticated user +client.profile - # get the profile for the authenticated user - client.profile - - # get a profile for someone found in network via ID - client.profile(:id => 'gNma67_AdI') - - # get a profile for someone via their public profile url - client.profile(:url => 'http://www.linkedin.com/in/netherland') +# get a profile for someone found in network via ID +client.profile(:id => 'gNma67_AdI') +# get a profile for someone via their public profile url +client.profile(:url => 'http://www.linkedin.com/in/netherland') +``` More examples in the [examples folder](http://github.com/pengwynn/linkedin/blob/master/examples). From b3f496c8a4ba3d7c950483d23a13f967d18f394a Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 18 Jun 2013 20:07:27 -0700 Subject: [PATCH 020/117] Updating all of the old development gems --- Rakefile | 1 + linkedin.gemspec | 14 +- .../LinkedIn_Api/Company_API.yml | 92 ++++--- .../_authorize_from_request.yml | 53 ++-- .../LinkedIn_Client/_request_token.yml | 53 ++-- .../_request_token/with_a_callback_url.yml | 53 ++-- .../_request_token/with_default_options.yml | 53 ++-- .../_search/by_company_name_option.yml | 162 ++++++------ .../by_first_name_and_last_name_options.yml | 191 ++++++-------- ...name_and_last_name_options_with_fields.yml | 219 +++++++--------- .../_search/by_keywords_string_parameter.yml | 105 +++----- .../_search/by_single_keywords_option.yml | 105 +++----- ...single_keywords_option_with_pagination.yml | 72 +++-- .../by_keywords_options_with_fields.yml | 247 ++++++++++++++++-- .../by_keywords_string_parameter.yml | 216 +++++---------- .../by_single_keywords_option.yml | 216 +++++---------- ..._keywords_option_with_facets_to_return.yml | 216 +++++---------- ...single_keywords_option_with_pagination.yml | 190 +++++--------- 18 files changed, 1044 insertions(+), 1214 deletions(-) diff --git a/Rakefile b/Rakefile index 67a599f9..ab591f4c 100755 --- a/Rakefile +++ b/Rakefile @@ -8,6 +8,7 @@ RSpec::Core::RakeTask.new(:spec) task :test => :spec task :default => :spec +load 'vcr/tasks/vcr.rake' require 'rdoc/task' require File.expand_path('../lib/linked_in/version', __FILE__) diff --git a/linkedin.gemspec b/linkedin.gemspec index 1cb929bc..91f69fd6 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -5,13 +5,13 @@ Gem::Specification.new do |gem| gem.add_dependency 'hashie', ['>= 1.2', '< 2.1'] gem.add_dependency 'multi_json', '~> 1.0' gem.add_dependency 'oauth', '~> 0.4' - gem.add_development_dependency 'json', '~> 1.6' - gem.add_development_dependency 'rake', '~> 0.9' - gem.add_development_dependency 'rdoc', '~> 3.8' - gem.add_development_dependency 'rspec', '~> 2.6' - gem.add_development_dependency 'simplecov', '~> 0.5' - gem.add_development_dependency 'vcr', '~> 1.10' - gem.add_development_dependency 'webmock', '~> 1.9' + # gem.add_development_dependency 'json', '~> 1.6' + gem.add_development_dependency 'rake', '~> 10' + gem.add_development_dependency 'rdoc', '~> 4.0' + gem.add_development_dependency 'rspec', '~> 2.13' + gem.add_development_dependency 'simplecov', '~> 0.7' + gem.add_development_dependency 'vcr', '~> 2.5' + gem.add_development_dependency 'webmock', '~> 1.11' gem.authors = ["Wynn Netherland", "Josh Kalderimis"] gem.description = %q{Ruby wrapper for the LinkedIn API} gem.email = ['wynn.netherland@gmail.com', 'josh.kalderimis@gmail.com'] diff --git a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml index 2e4da51b..1128327f 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml @@ -1,73 +1,81 @@ --- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/companies/id=1586 - body: !!null +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/companies/id=1586 + body: + encoding: US-ASCII + string: '' headers: - x-li-format: + X-Li-Format: - json - user-agent: + User-Agent: - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="consumer_key", - oauth_nonce="nonce", oauth_signature="signature", + Authorization: + - OAuth oauth_consumer_key="consumer_key", oauth_nonce="nonce", oauth_signature="signature", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129843", oauth_token="token", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK headers: - server: + Server: - Apache-Coyote/1.1 - vary: + Vary: - ! '*' - x-li-format: + X-Li-Format: - json - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - date: + Date: - Thu, 20 Oct 2011 16:57:24 GMT - body: ! "{\n \"id\": 1586,\n \"name\": \"Amazon\"\n}" + body: + encoding: UTF-8 + string: ! "{\n \"id\": 1586,\n \"name\": \"Amazon\"\n}" http_version: '1.1' -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/companies/id=1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range) - body: !!null + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/companies/id=1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range) + body: + encoding: US-ASCII + string: '' headers: - x-li-format: + X-Li-Format: - json - user-agent: + User-Agent: - OAuth gem v0.4.5 - authorization: - - OAuth oauth_consumer_key="consumer_key", - oauth_nonce="nonc", oauth_signature="signature", + Authorization: + - OAuth oauth_consumer_key="consumer_key", oauth_nonce="nonc", oauth_signature="signature", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129844", oauth_token="token", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK headers: - server: + Server: - Apache-Coyote/1.1 - vary: + Vary: - ! '*' - x-li-format: + X-Li-Format: - json - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - date: + Date: - Thu, 20 Oct 2011 16:57:24 GMT - body: ! "{\n \"employeeCountRange\": {\n \"code\": \"I\",\n \"name\": \"10001+\"\n - },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\": {\n \"_total\": - 1,\n \"values\": [{\n \"address\": {\n \"city\": \"Seattle\",\n - \"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n \"isHeadquarters\": - true\n }]\n },\n \"name\": \"Amazon\"\n}" + body: + encoding: UTF-8 + string: ! "{\n \"employeeCountRange\": {\n \"code\": \"I\",\n \"name\": + \"10001+\"\n },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\": + {\n \"_total\": 1,\n \"values\": [{\n \"address\": {\n \"city\": + \"Seattle\",\n \"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n + \ \"isHeadquarters\": true\n }]\n },\n \"name\": \"Amazon\"\n}" http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml index 2e7969fb..445c69ba 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml @@ -1,28 +1,37 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/accessToken - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: post + uri: https://api.linkedin.com/uas/oauth/accessToken + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.4 - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", oauth_nonce="ztYyddIoKJ8flDjBJyveOSqm96CLaEM4QpOC0CSW0E", oauth_signature="NSp3ZDtycelP7wsDM7dsuDTZGys%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297095033", oauth_token="2f5b42dd-1e0e-4f8f-a03c-1e510bde5935", oauth_verifier="25038", oauth_version="1.0" - content-length: - - "0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", + oauth_nonce="ztYyddIoKJ8flDjBJyveOSqm96CLaEM4QpOC0CSW0E", oauth_signature="NSp3ZDtycelP7wsDM7dsuDTZGys%3D", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297095033", oauth_token="2f5b42dd-1e0e-4f8f-a03c-1e510bde5935", + oauth_verifier="25038", oauth_version="1.0" + Content-Length: + - '0' + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - server: + Server: - Apache-Coyote/1.1 - date: + Date: - Mon, 07 Feb 2011 16:10:34 GMT - content-length: - - "156" - body: oauth_token=28774cd4-fbe1-4e6e-a05e-1243f6471933&oauth_token_secret=2fafe259-976e-41ad-a6f5-d26bbba42923&oauth_expires_in=0&oauth_authorization_expires_in=0 - http_version: "1.1" + Content-Length: + - '156' + body: + encoding: UTF-8 + string: oauth_token=28774cd4-fbe1-4e6e-a05e-1243f6471933&oauth_token_secret=2fafe259-976e-41ad-a6f5-d26bbba42923&oauth_expires_in=0&oauth_authorization_expires_in=0 + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml index de938eb5..733bcdec 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml @@ -1,28 +1,37 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: post + uri: https://api.linkedin.com/uas/oauth/requestToken + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.4 - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", oauth_nonce="jSQpxoXaoTl2e0dALgc7VKzRJE993wqzRWuXuF0H0", oauth_signature="wn%2Bw0Jvyb9TQ4DC8sq3CxWMDM7Y%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297093507", oauth_version="1.0" - content-length: - - "0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", + oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", + oauth_nonce="jSQpxoXaoTl2e0dALgc7VKzRJE993wqzRWuXuF0H0", oauth_signature="wn%2Bw0Jvyb9TQ4DC8sq3CxWMDM7Y%3D", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297093507", oauth_version="1.0" + Content-Length: + - '0' + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - server: + Server: - Apache-Coyote/1.1 - date: + Date: - Mon, 07 Feb 2011 15:45:08 GMT - content-length: - - "236" - body: oauth_token=95f8619b-7069-433b-ac9e-35dfba02b0f7&oauth_token_secret=dffd7996-6943-48ce-be6b-771e86b10f92&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 - http_version: "1.1" + Content-Length: + - '236' + body: + encoding: UTF-8 + string: oauth_token=95f8619b-7069-433b-ac9e-35dfba02b0f7&oauth_token_secret=dffd7996-6943-48ce-be6b-771e86b10f92&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml index 47234190..6734f1af 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml @@ -1,28 +1,37 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: post + uri: https://api.linkedin.com/uas/oauth/requestToken + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.4 - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="http%3A%2F%2Fwww.josh.com", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", oauth_nonce="OYVkd4yi5oe16NGQMbANhBB8cabeynkTX28fOEjG1rs", oauth_signature="%2BwgZ8nb2CM5oWRpJEC5U0554uGk%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297103790", oauth_version="1.0" - content-length: - - "0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="http%3A%2F%2Fwww.josh.com", + oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", + oauth_nonce="OYVkd4yi5oe16NGQMbANhBB8cabeynkTX28fOEjG1rs", oauth_signature="%2BwgZ8nb2CM5oWRpJEC5U0554uGk%3D", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297103790", oauth_version="1.0" + Content-Length: + - '0' + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - server: + Server: - Apache-Coyote/1.1 - date: + Date: - Mon, 07 Feb 2011 18:36:30 GMT - content-length: - - "236" - body: oauth_token=f8af7ca2-ca1a-48f2-be6a-bd7b721e2868&oauth_token_secret=c5ec7928-7740-4813-a202-2be8800a0b32&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 - http_version: "1.1" + Content-Length: + - '236' + body: + encoding: UTF-8 + string: oauth_token=f8af7ca2-ca1a-48f2-be6a-bd7b721e2868&oauth_token_secret=c5ec7928-7740-4813-a202-2be8800a0b32&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml index 2c814db5..58ac8c52 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml @@ -1,28 +1,37 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :post - uri: https://api.linkedin.com:443/uas/oauth/requestToken - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: post + uri: https://api.linkedin.com/uas/oauth/requestToken + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.4 - authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", oauth_nonce="5INIHjRHjfLCYQX0r7cArMGiUPXoH62wEAgbrh1M", oauth_signature="K1kJU%2FQsuIKj1OUKsaUIcM1xr8Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297103788", oauth_version="1.0" - content-length: - - "0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", + oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", + oauth_nonce="5INIHjRHjfLCYQX0r7cArMGiUPXoH62wEAgbrh1M", oauth_signature="K1kJU%2FQsuIKj1OUKsaUIcM1xr8Q%3D", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297103788", oauth_version="1.0" + Content-Length: + - '0' + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - server: + Server: - Apache-Coyote/1.1 - date: + Date: - Mon, 07 Feb 2011 18:36:29 GMT - content-length: - - "236" - body: oauth_token=fe9d7429-e5cc-47c2-b396-23521d86cf9c&oauth_token_secret=092e7c24-8ad8-4ca9-8f92-8c4f17664bcb&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 - http_version: "1.1" + Content-Length: + - '236' + body: + encoding: UTF-8 + string: oauth_token=fe9d7429-e5cc-47c2-b396-23521d86cf9c&oauth_token_secret=092e7c24-8ad8-4ca9-8f92-8c4f17664bcb&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml index dadeef8a..45e14562 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml @@ -1,109 +1,93 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?company-name=linkedin - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?company-name=linkedin + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="TkuTVt34MgzfuheowxiWtlQzdNdJBfGwh8uNqwcDrS4", oauth_signature="TQsnrPLgwq6hrw4G9VaPwJIKW8o%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - x-li-format: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="TkuTVt34MgzfuheowxiWtlQzdNdJBfGwh8uNqwcDrS4", + oauth_signature="TQsnrPLgwq6hrw4G9VaPwJIKW8o%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + X-Li-Format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - 0UF1FY9HHN - vary: - - "*" - transfer-encoding: + Vary: + - ! '*' + Transfer-Encoding: - chunked - server: + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - date: + Date: - Wed, 10 Apr 2013 22:07:36 GMT - x-li-format: + X-Li-Format: - json - body: |- - { - "numResults": 0, - "people": {"_total": 0} - } - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?company-name=IBM - body: - headers: - user-agent: + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 0,\n \"people\": {\"_total\": 0}\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?company-name=IBM + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="dixy4z5VMylJTypqa3abkuEnVrjFtb5V5hd9DpMKB0", oauth_signature="OOD9beldHTV5d9a6fVpPUqOB%2BPs%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631799", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - x-li-format: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="dixy4z5VMylJTypqa3abkuEnVrjFtb5V5hd9DpMKB0", + oauth_signature="OOD9beldHTV5d9a6fVpPUqOB%2BPs%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631799", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + X-Li-Format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - L00YMW359U - vary: - - "*" - transfer-encoding: + Vary: + - ! '*' + Transfer-Encoding: - chunked - server: + Server: - Apache-Coyote/1.1 - date: + Date: - Wed, 10 Apr 2013 22:09:58 GMT - x-li-format: + X-Li-Format: - json - content-type: + Content-Type: - application/json;charset=UTF-8 - body: |- - { - "numResults": 6, - "people": { - "_total": 6, - "values": [ - { - "firstName": "Ryan", - "id": "KHkgwBMaa-", - "lastName": "Sue" - }, - { - "firstName": "Ben", - "id": "lljISRB-WQ", - "lastName": "Mejia" - }, - { - "firstName": "James", - "id": "zLwxyfa2cv", - "lastName": "Stevenson" - }, - { - "firstName": "Charles", - "id": "r5Kzi9Um-e", - "lastName": "Kafoglis" - }, - { - "firstName": "Sauraj", - "id": "RLJu6NhdI2", - "lastName": "Goswami" - }, - { - "firstName": "Jonathan", - "id": "NgAxaSCyZ3", - "lastName": "Hedstrom" - } - ] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": + [\n {\n \"firstName\": \"Ryan\",\n \"id\": \"KHkgwBMaa-\",\n + \ \"lastName\": \"Sue\"\n },\n {\n \"firstName\": \"Ben\",\n + \ \"id\": \"lljISRB-WQ\",\n \"lastName\": \"Mejia\"\n },\n + \ {\n \"firstName\": \"James\",\n \"id\": \"zLwxyfa2cv\",\n + \ \"lastName\": \"Stevenson\"\n },\n {\n \"firstName\": + \"Charles\",\n \"id\": \"r5Kzi9Um-e\",\n \"lastName\": \"Kafoglis\"\n + \ },\n {\n \"firstName\": \"Sauraj\",\n \"id\": \"RLJu6NhdI2\",\n + \ \"lastName\": \"Goswami\"\n },\n {\n \"firstName\": + \"Jonathan\",\n \"id\": \"NgAxaSCyZ3\",\n \"lastName\": \"Hedstrom\"\n + \ }\n ]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml index 16b15099..8baf1929 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml @@ -1,131 +1,100 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?first-name=Giliardi&last-name=Pires - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?first-name=Giliardi&last-name=Pires + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - user-agent: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", + oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + response: + status: code: 200 message: OK - headers: - vary: - - "*" - transfer-encoding: + headers: + Vary: + - ! '*' + Transfer-Encoding: - chunked - server: + Server: - Apache-Coyote/1.1 - x-li-format: + X-Li-Format: - json - x-li-request-id: + X-Li-Request-Id: - CH30LTU9DW - date: + Date: - Wed, 10 Apr 2013 22:07:36 GMT - content-type: + Content-Type: - application/json;charset=UTF-8 - body: |- - { - "numResults": 0, - "people": {"_total": 0} - } - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?first-name=Charles&last-name=Garcia - body: - headers: - x-li-format: + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 0,\n \"people\": {\"_total\": 0}\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?first-name=Charles&last-name=Garcia + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - user-agent: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="lTIll68hM4A1tc0I56h92w5znsrjFfJ4nDvKpSqDfg", oauth_signature="AhGLaPTVAJvv8pncUjz2j8C6%2B%2FA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365632102", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="lTIll68hM4A1tc0I56h92w5znsrjFfJ4nDvKpSqDfg", + oauth_signature="AhGLaPTVAJvv8pncUjz2j8C6%2B%2FA%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365632102", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + response: + status: code: 200 message: OK - headers: - vary: - - "*" - transfer-encoding: + headers: + Vary: + - ! '*' + Transfer-Encoding: - chunked - server: + Server: - Apache-Coyote/1.1 - x-li-request-id: + X-Li-Request-Id: - 6AXWFPE8I6 - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:15:03 GMT - content-type: + Content-Type: - application/json;charset=UTF-8 - body: |- - { - "numResults": 308, - "people": { - "_count": 10, - "_start": 0, - "_total": 110, - "values": [ - { - "firstName": "Charles", - "id": "2zk34r8TvA", - "lastName": "Garcia, CFA" - }, - { - "firstName": "Charles R.", - "id": "NjwO1vU6P6", - "lastName": "Garcia Jr." - }, - { - "firstName": "Charles", - "id": "j8ZczJo44W", - "lastName": "Garcia-Tobin" - }, - { - "firstName": "Charles", - "id": "jYfrk5GM29", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "C-2ASm3SQ1", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "LG__MFCUTJ", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "wjopxKqYYM", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "AtFQt5Lf1V", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "MUXIZwfehE", - "lastName": "Garcia" - }, - { - "firstName": "Charles", - "id": "koTmAyWE8J", - "lastName": "Schwalbe Garcia-Lago" - } - ] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n + \ \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": + \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, + CFA\"\n },\n {\n \"firstName\": \"Charles R.\",\n \"id\": + \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\"\n },\n {\n + \ \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n \"lastName\": + \"Garcia-Tobin\"\n },\n {\n \"firstName\": \"Charles\",\n + \ \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\"\n },\n + \ {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n + \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n \"lastName\": \"Garcia\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n + \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n \"lastName\": \"Garcia\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n + \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"Charles\",\n \"id\": \"koTmAyWE8J\",\n \"lastName\": \"Schwalbe + Garcia-Lago\"\n }\n ]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml index 43fbffed..54ddedd6 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml @@ -1,147 +1,112 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Giliardi&last-name=Pires - body: - headers: - user-agent: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Giliardi&last-name=Pires + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XxYZ3yqoTFr792YTu6TmJPFCrrkZejwXkORldtyZGI", oauth_signature="cBkWRwhVxBDozgn5sCXBwGIoer4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - x-li-format: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XxYZ3yqoTFr792YTu6TmJPFCrrkZejwXkORldtyZGI", + oauth_signature="cBkWRwhVxBDozgn5sCXBwGIoer4%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631657", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + X-Li-Format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - server: + headers: + Server: - Apache-Coyote/1.1 - transfer-encoding: + Transfer-Encoding: - chunked - vary: - - "*" - content-type: + Vary: + - ! '*' + Content-Type: - application/json;charset=UTF-8 - x-li-request-id: + X-Li-Request-Id: - G0J3Z1XF1E - date: + Date: - Wed, 10 Apr 2013 22:07:36 GMT - x-li-format: + X-Li-Format: - json - body: |- - { - "numResults": 0, - "people": {"_total": 0} - } - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Charles&last-name=Garcia - body: - headers: - user-agent: + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 0,\n \"people\": {\"_total\": 0}\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,public-profile-url,picture-url),num-results)?first-name=Charles&last-name=Garcia + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: - OAuth gem v0.4.7 - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="apcqck1ATxZYGou1ynnfBm6OgZFBz4TXKeuPo160NU", oauth_signature="zB0MtadBiOOL2rAX%2FdHn71fZyOA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631934", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - x-li-format: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="apcqck1ATxZYGou1ynnfBm6OgZFBz4TXKeuPo160NU", + oauth_signature="zB0MtadBiOOL2rAX%2FdHn71fZyOA%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631934", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + X-Li-Format: - json - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - server: + headers: + Server: - Apache-Coyote/1.1 - transfer-encoding: + Transfer-Encoding: - chunked - vary: - - "*" - content-type: + Vary: + - ! '*' + Content-Type: - application/json;charset=UTF-8 - x-li-request-id: + X-Li-Request-Id: - 7A7TZHN5V9 - date: + Date: - Wed, 10 Apr 2013 22:12:14 GMT - x-li-format: + X-Li-Format: - json - body: |- - { - "numResults": 308, - "people": { - "_count": 10, - "_start": 0, - "_total": 110, - "values": [ - { - "firstName": "Charles", - "id": "2zk34r8TvA", - "lastName": "Garcia, CFA", - "publicProfileUrl": "http://www.linkedin.com/in/charlesgarcia" - }, - { - "firstName": "Charles R.", - "id": "NjwO1vU6P6", - "lastName": "Garcia Jr.", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_eyd5KukV6r4QDft-oYwsKfzsXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWUUfdKb", - "publicProfileUrl": "http://www.linkedin.com/in/knightwealthmanagement" - }, - { - "firstName": "Charles", - "id": "j8ZczJo44W", - "lastName": "Garcia-Tobin", - "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37" - }, - { - "firstName": "Charles", - "id": "jYfrk5GM29", - "lastName": "Garcia", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m", - "publicProfileUrl": "http://www.linkedin.com/in/charleshgarcia" - }, - { - "firstName": "Charles", - "id": "C-2ASm3SQ1", - "lastName": "Garcia", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib", - "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/26/1b2/b28" - }, - { - "firstName": "Charles", - "id": "LG__MFCUTJ", - "lastName": "Garcia", - "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/5/465/b00" - }, - { - "firstName": "Charles", - "id": "wjopxKqYYM", - "lastName": "Garcia", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb", - "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/8/152/3ab" - }, - { - "firstName": "Charles", - "id": "AtFQt5Lf1V", - "lastName": "Garcia", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq", - "publicProfileUrl": "http://www.linkedin.com/in/chasgarcia" - }, - { - "firstName": "Charles", - "id": "MUXIZwfehE", - "lastName": "Garcia", - "publicProfileUrl": "http://www.linkedin.com/pub/charles-garcia/14/6a7/81" - }, - { - "firstName": "Charles", - "id": "koTmAyWE8J", - "lastName": "Schwalbe Garcia-Lago", - "pictureUrl": "http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb", - "publicProfileUrl": "http://www.linkedin.com/in/charlesschwalbe" - } - ] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n + \ \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": + \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, + CFA\",\n \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesgarcia\"\n + \ },\n {\n \"firstName\": \"Charles R.\",\n \"id\": + \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\",\n \"pictureUrl\": + \"http://m3.licdn.com/mpr/mprx/0_eyd5KukV6r4QDft-oYwsKfzsXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWUUfdKb\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/in/knightwealthmanagement\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n + \ \"lastName\": \"Garcia-Tobin\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"jYfrk5GM29\",\n + \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/in/charleshgarcia\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n + \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/26/1b2/b28\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n + \ \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/5/465/b00\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n + \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/8/152/3ab\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n + \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/in/chasgarcia\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n + \ \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/14/6a7/81\"\n + \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"koTmAyWE8J\",\n + \ \"lastName\": \"Schwalbe Garcia-Lago\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb\",\n + \ \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesschwalbe\"\n + \ }\n ]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml index 796feb24..5180a0d1 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml @@ -1,72 +1,53 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?keywords=github - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?keywords=github + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="KJPWM7qluIAetEW5kk8NSQuB3ssr1S2v6HBpofhFY", oauth_signature="LEh2O3mlLU6GqhsuU4admW%2B1hDw%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="KJPWM7qluIAetEW5kk8NSQuB3ssr1S2v6HBpofhFY", + oauth_signature="LEh2O3mlLU6GqhsuU4admW%2B1hDw%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - L4BQ08FWG8 - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:35 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "numResults": 6, - "people": { - "_total": 6, - "values": [ - { - "firstName": "Shay", - "id": "ucXjUw4M9J", - "lastName": "Frendt" - }, - { - "firstName": "Scott", - "id": "t6mvVsY3df", - "lastName": "Smith" - }, - { - "firstName": "Philip", - "id": "ZeSnXwtz6Y", - "lastName": "Corliss" - }, - { - "firstName": "Jay", - "id": "i24wDA2GrH", - "lastName": "Beavers" - }, - { - "firstName": "Chris", - "id": "SJBelisgHh", - "lastName": "Wiswell" - }, - { - "firstName": "Satish", - "id": "V1FPuGot-I", - "lastName": "Talim" - } - ] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": + [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n + \ \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": + \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n + \ },\n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n + \ \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": + \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n + \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n + \ \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": + \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n + \ }\n ]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml index 3eb23203..58a00593 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml @@ -1,72 +1,53 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?keywords=github - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?keywords=github + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="DlBgAEJHkDYAnMMZwzFObsUNcCmRbzFldB4dV1yeE", oauth_signature="RLiPr%2FC1bq9Dv29W3mjezy1of54%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="DlBgAEJHkDYAnMMZwzFObsUNcCmRbzFldB4dV1yeE", + oauth_signature="RLiPr%2FC1bq9Dv29W3mjezy1of54%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631655", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - 5BE8O0G2CK - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:35 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "numResults": 6, - "people": { - "_total": 6, - "values": [ - { - "firstName": "Shay", - "id": "ucXjUw4M9J", - "lastName": "Frendt" - }, - { - "firstName": "Scott", - "id": "t6mvVsY3df", - "lastName": "Smith" - }, - { - "firstName": "Philip", - "id": "ZeSnXwtz6Y", - "lastName": "Corliss" - }, - { - "firstName": "Jay", - "id": "i24wDA2GrH", - "lastName": "Beavers" - }, - { - "firstName": "Chris", - "id": "SJBelisgHh", - "lastName": "Wiswell" - }, - { - "firstName": "Satish", - "id": "V1FPuGot-I", - "lastName": "Talim" - } - ] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": + [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n + \ \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": + \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n + \ },\n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n + \ \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": + \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n + \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n + \ \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": + \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n + \ }\n ]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml index 81c42d88..cec486ed 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml @@ -1,47 +1,45 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/people-search?count=5&keywords=github&start=5 - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people-search?count=5&keywords=github&start=5 + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="PfrLyLbcfxXAJshwSsQ4YDPBk1OncuNV0RjgB4fbVEs", oauth_signature="16fUd%2BHUkWJULyxMCEbISV0Ltks%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="PfrLyLbcfxXAJshwSsQ4YDPBk1OncuNV0RjgB4fbVEs", + oauth_signature="16fUd%2BHUkWJULyxMCEbISV0Ltks%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - JI3L4KN8K1 - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:36 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "numResults": 6, - "people": { - "_count": 1, - "_start": 5, - "_total": 6, - "values": [{ - "firstName": "Satish", - "id": "V1FPuGot-I", - "lastName": "Talim" - }] - } - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_count\": 1,\n \"_start\": + 5,\n \"_total\": 6,\n \"values\": [{\n \"firstName\": \"Satish\",\n + \ \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n }]\n }\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index dbe58553..0f3c40fa 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -1,35 +1,232 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search:(companies:(id,name,industries,description,specialties),num-results)?keywords=apple - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/company-search:(companies:(id,name,industries,description,specialties),num-results)?keywords=apple + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XIAUlVH3VfeqacvVEQzCvdLSyy9swruF3mouF9mtc", oauth_signature="ggZObnJ1w5zMIBixfluGoUYZVSg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="XIAUlVH3VfeqacvVEQzCvdLSyy9swruF3mouF9mtc", + oauth_signature="ggZObnJ1w5zMIBixfluGoUYZVSg%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - 68RH2HSO61 - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:35 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 8450,\n \"values\": [\n {\n \"description\": \"Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the mobile phone with its revolutionary iPhone and App Store, and is defining the future of mobile media and computing devices with iPad.\",\n \"id\": 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"Apple\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Innovative product development\",\n \"world class operations\",\n \"Retail\",\n \"Telephone Support\"\n ]\n }\n },\n {\n \"description\": \"Experience the Difference. \\r\\nFor over 40 years, Apple Vacations has provided the most value in vacations to millions of people. Throughout the years, we\\u2019ve provided what you want in a vacation \\u2013 great service, convenience, and value. We understand just how important your vacation is. We know because, like you, vacations are important to us too. \\r\\n \\r\\nApple Vacations is a company of energetic, hardworking employees with the same entrepreneurial attitudes as our founders. Headquartered just outside Philadelphia with regional offices in Chicago and Boston, the company is completely focused on providing quality vacations for our customers. Employees are empowered to make decisions that impact the quality of their customers\\u2019 vacations on a daily basis. Since our humble beginnings, Apple Vacations has created the ultimate \\u201cbeginning-to-end\\u201d vacation experience for customers. Apple Vacations employees will greet you at your departure airport in more than 20 cities; and will meet your flight in our charter destinations. Apple Vacations\\u2019 sister companies, flies customers to their destinations from more than 20 U.S. cities; and Amstar, is the destination management company in-resort with uniformed representatives, who will greet you upon arrival and assist you while you are at your resort. Unlike any other travel company, Apple Vacations truly provides the ultimate in a quality vacation experience.\",\n \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"30\",\n \"name\": \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n ]\n }\n },\n {\n \"description\": \"Big Apple International Realty has been listing, selling and managing Residential Real Estate in four counties of the Greater Orlando and Central Florida areas for over five years. Because our Property Management Division had grown substantially, and to fill the growing need for property management services in Central Florida, we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease Only\\\" services at competitive prices, we currently manage close to 50 properties in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n {\n \"description\": \"Apple & Associates is an executive search firm that specializes in the Pharmaceutical, Medical Device and Consumer Product Industries. We provide extensive coverage of these worldwide markets and have forged a solid reputation in the industry as a competent, aggressive, and resource-rich recruiting firm. We are a nation-wide company with offices through-out the United States. \\r\\n\\r\\nApple & Associates belongs to Intercity Personnel Associates (IPA) and the Top Echelon Network. Through these worldwide recruiting networks, we share confidentially coded information about available positions and receive qualified candidates within a short period of time. With one phone call you not only have rapid access to our candidates, but also to qualified candidates from over 1,000 of the nation\\u2019s other top recruiting firms. Because our executive recruiters specialize in different industry segments, we can give you the service you deserve in a fast, focused, and efficient manner and provide you with quality industry specific candidates. \\r\\n\\r\\nWe realize the importance of hiring professionals who understand and are able to assimilate with your company\\u2019s business model, culture, process, equipment, and materials. Our team has studied the hiring decisions that make the firms in the Pharmaceutical and Medical Device industries so successful. Our candidates will meet the standard your company demands, with the technical and industry background to match.\",\n \"id\": 112136,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": {\n \"_total\": 20,\n \"values\": [\n \"Medical Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n \"Engineering\",\n \"Marketing\",\n \"Sales\",\n \"Human Resources\",\n \"Science\",\n \"Finance\",\n \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n \"Six Sigma\",\n \"IT\",\n \"chemist\",\n \"Executive Management\"\n ]\n }\n },\n {\n \"description\": \"Headquartered in Singapore and a presence in 9 countries globally, Stone Apple is a Specialized Consulting firm focused mainly on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge Management & Application Integration with a strong product portfolio, analytical applications, Proprietary Industry Solutions and strong services capability \\r\\n\\r\\nStone Apple has a strong offshore presence in SE Asia with development centers in Vietnam and Malaysia. The Company has a strong presence and networks in Asia Pacific, Europe and United States to support their rapidly growing MNC enterprise customer base \\r\\n\\r\\nStone Apple provides customized solutions to meet the changing needs of enterprises globally. From leading industry methodologies to in-house proven models, Stone Apple collaborates with their customers to deliver tangible business results that impact their bottom line.\",\n \"id\": 772044,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": \"Information Technology & Services\"\n }]\n },\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"description\": \"iSquare S.A. is the Apple Authorised Distributor of Greece and Cyprus since September 2010. iSquare is distributing Apple products but also plans, implements and provides intergrated solutions, based on the innovative Apple products and technology. iSquare's strategic goal is to increase the use of Apple products among the Greek consumers, but also to provide users the ultimate Apple experience.\\r\\n\\r\\niSquare creates and provides a complete ecosystem for Apple products and services, aiming to bring Greek customers closer to Apple's philosophy. In order to do that, iSquare:\\r\\n\\r\\n- Creates a wide network of POS (Points Of Sales) that spreads throughout Greece and Cyprus\\r\\n\\r\\n- Develops its relations with major retail chains in order to promote Apple products to a wide range of customers\\r\\n\\r\\n- Creates a unique network of stores exclusively for Apple products, always in line with the high standards of \\r\\n Apple Premium Reseller program\\r\\n\\r\\n- Invests on continuous and in depth training of the sales network in order to provide the best before and after sale \\r\\n support, according to Apple's and iSquare's high standards\\r\\n\\r\\n- Focuses on the crucial sector of Education\\r\\n\\r\\n- Constantly works to improve the support of Apple products and solutions\\r\\n\\r\\n- Completes Apple's ecosystem as the distributor of software and peripherals from well known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, iSquare aspires to bring the Apple products at the stature they deserve within the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n {\n \"description\": \"Filex (Moj Apple Du\xC4\x87an i Servis) je autorizirani Apple partner za prodaju, servis i podr\xC5\xA1ku.\\r\\n\\r\\nFilex je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapre\xC4\x91ujemo prepoznatljivost Apple tehnologija prezentiraju\xC4\x87i upotrebnu vrijednost Apple rje\xC5\xA1enja, na doma\xC4\x87em i regionalnom tr\xC5\xBEi\xC5\xA1tu.\\r\\n\\r\\nNa\xC5\xA1 fokus nije isklju\xC4\x8Divo na tehnologijama ve\xC4\x87 kako te tehnologije podrediti potrebama korisnika. Sukladno tome, Filex nije samo jo\xC5\xA1 jedna u nizu trgovina u koju \xC4\x87ete do\xC4\x87i \\\"pokupiti\\\" svoj Apple ure\xC4\x91aj, ve\xC4\x87 mjesto na kojem \xC4\x87ete postavljati pitanja, razgovarati i diskutirati te na kraju iza\xC4\x87i sa rje\xC5\xA1enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte nas preko na\xC5\xA1eg Internet Store-a (www.filex.hr), ili nam pi\xC5\xA1ite na prodaja@filx.hr ili servis@filex.hr.\\r\\nI svakako nam se pridru\xC5\xBEite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-Du\xC4\x87an-i-Servis/131194173598671\\r\\n\\r\\nVa\xC5\xA1e zadovoljstvo na\xC5\xA1a je misija!\",\n \"id\": 2303504,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n \"name\": \"Filex Apple Store & Support\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Apple Store\",\n \"Apple Podr\xC5\xA1ka i Servis\",\n \"Apple Rje\xC5\xA1enja\",\n \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over Apple met zorg en proberen u zo goed mogelijk in te lichten als Apple-Fan in Vlaanderen. Dagelijks circuleren er duizenden geruchten over Apple in het algemeen, onze taak is deze te bundelen en u mee te delen.\\r\\n\\r\\nDit doen we met veel liefde voor de verschillende producten en voor Apple in het algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n \"mac\"\n ]\n }\n },\n {\n \"description\": \"OGGO est une soci\xC3\xA9t\xC3\xA9 de conseils et solutions Apple Macintosh bas\xC3\xA9e \xC3\xA0 Gen\xC3\xA8ve, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos services en un coup d'oeil :\\r\\n\\r\\n// R\xC3\xA9parations\\r\\n// Optimisations mat\xC3\xA9rielles\\r\\n// Contrats de maintenance\\r\\n// D\xC3\xA9pannage sur site\\r\\n// Interventions urgentes\\r\\n// Maintenance\\r\\n// Aide \xC3\xA0 l'achat\\r\\n// Formations\",\n \"id\": 2260437,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": \"Information Technology & Services\"\n }]\n },\n \"name\": \"OGGO - Services Apple Macintosh\",\n \"specialties\": {\n \"_total\": 7,\n \"values\": [\n \"Consulting & conseils Apple Macintosh\",\n \"Support Apple Macintosh\",\n \"Maintenance Mac OS X Server\",\n \"D\xC3\xA9pannage Mac OS X\",\n \"Installation Mac OS X Server\",\n \"Interventions Apple Macintosh\",\n \"Formation Apple Macintosh\"\n ]\n }\n },\n {\n \"description\": \"Apple-Crumble provides sound advice, sales and support for all apple mac products and related peripherals including external hard drives, printers, scanners and both apple and 3rd party software. Apple-Crumble are also experts in troubleshooting, repair and maintenance. Our staff are apple trained and certified with over 15 years experience.\\r\\n\\r\\nAll work is guaranteed and all enquiries are welcome.\\r\\n\\r\\nWe are obviously very \\u2018pro\\u2019 apple and firmly believe that once you go mac you never go back!\\r\\n\\r\\nFor your convenience Apple-Crumble have our own workshop and offices with free parking in Penzance, Cornwall so that you have the extra peace of mind knowing that your equipment is being serviced in a clean and safe environment. You may also view, demo and purchase new hardware or add-ons, as well as discussing tailor-made options for you and/or your business.\\r\\n\\r\\nApple-Crumble\\u2019s service extends to on-site visits for emergency or contract call-outs, as well as delivery and installation of new products and systems. We cover Penzance, Falmouth, Helston and the Lizard, St Ives, Hayle, Truro, Camborne, Redruth, and all surrounding areas including north Cornwall and Devon\\r\\n\\r\\nIn most cases it is safer and more cost effective to bring your hardware to us as we are geared up for any static or time delay issues, but it is very rare that we cannot provide a solution, wherever you may be!\",\n \"id\": 1049054,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n },\n \"numResults\": 8450\n\ - }" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n + \ \"_total\": 8450,\n \"values\": [\n {\n \"description\": + \"Apple designs Macs, the best personal computers in the world, along with + OS X, iLife, iWork and professional software. Apple leads the digital music + revolution with its iPods and iTunes online store. Apple has reinvented the + mobile phone with its revolutionary iPhone and App Store, and is defining + the future of mobile media and computing devices with iPad.\",\n \"id\": + 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": + [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n + \ }]\n },\n \"name\": \"Apple\",\n \"specialties\": + {\n \"_total\": 4,\n \"values\": [\n \"Innovative + product development\",\n \"world class operations\",\n \"Retail\",\n + \ \"Telephone Support\"\n ]\n }\n },\n {\n + \ \"description\": \"Experience the Difference. \\r\\nFor over + 40 years, Apple Vacations has provided the most value in vacations to millions + of people. Throughout the years, we\\u2019ve provided what you want in a vacation + \\u2013 great service, convenience, and value. We understand just how important + your vacation is. We know because, like you, vacations are important to us + too. \\r\\n \\r\\nApple Vacations is a company of energetic, hardworking employees + with the same entrepreneurial attitudes as our founders. Headquartered just + outside Philadelphia with regional offices in Chicago and Boston, the company + is completely focused on providing quality vacations for our customers. Employees + are empowered to make decisions that impact the quality of their customers\\u2019 + vacations on a daily basis. Since our humble beginnings, Apple Vacations has + created the ultimate \\u201cbeginning-to-end\\u201d vacation experience for + customers. Apple Vacations employees will greet you at your departure airport + in more than 20 cities; and will meet your flight in our charter destinations. + Apple Vacations\\u2019 sister companies, flies customers to their destinations + from more than 20 U.S. cities; and Amstar, is the destination management company + in-resort with uniformed representatives, who will greet you upon arrival + and assist you while you are at your resort. Unlike any other travel company, + Apple Vacations truly provides the ultimate in a quality vacation experience.\",\n + \ \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n + \ \"values\": [{\n \"code\": \"30\",\n \"name\": + \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple + Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": + [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n + \ ]\n }\n },\n {\n \"description\": \"Big + Apple International Realty has been listing, selling and managing Residential + Real Estate in four counties of the Greater Orlando and Central Florida areas + for over five years. Because our Property Management Division had grown substantially, + and to fill the growing need for property management services in Central Florida, + we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease + Only\\\" services at competitive prices, we currently manage close to 50 properties + in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\": + {\n \"_total\": 1,\n \"values\": [{\n \"code\": + \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n + \ \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n + \ },\n {\n \"description\": \"Apple & Associates is an executive + search firm that specializes in the Pharmaceutical, Medical Device and Consumer + Product Industries. We provide extensive coverage of these worldwide markets + and have forged a solid reputation in the industry as a competent, aggressive, + and resource-rich recruiting firm. We are a nation-wide company with offices + through-out the United States. \\r\\n\\r\\nApple & Associates belongs to Intercity + Personnel Associates (IPA) and the Top Echelon Network. Through these worldwide + recruiting networks, we share confidentially coded information about available + positions and receive qualified candidates within a short period of time. + \ With one phone call you not only have rapid access to our candidates, but + also to qualified candidates from over 1,000 of the nation\\u2019s other top + recruiting firms. Because our executive recruiters specialize in different + industry segments, we can give you the service you deserve in a fast, focused, + and efficient manner and provide you with quality industry specific candidates. + \ \\r\\n\\r\\nWe realize the importance of hiring professionals who understand + and are able to assimilate with your company\\u2019s business model, culture, + process, equipment, and materials. Our team has studied the hiring decisions + that make the firms in the Pharmaceutical and Medical Device industries so + successful. Our candidates will meet the standard your company demands, with + the technical and industry background to match.\",\n \"id\": 112136,\n + \ \"industries\": {\n \"_total\": 1,\n \"values\": + [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n + \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": + {\n \"_total\": 20,\n \"values\": [\n \"Medical + Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n + \ \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n + \ \"Engineering\",\n \"Marketing\",\n \"Sales\",\n + \ \"Human Resources\",\n \"Science\",\n \"Finance\",\n + \ \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n + \ \"Six Sigma\",\n \"IT\",\n \"chemist\",\n + \ \"Executive Management\"\n ]\n }\n },\n {\n + \ \"description\": \"Headquartered in Singapore and a presence in 9 + countries globally, Stone Apple is a Specialized Consulting firm focused mainly + on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge + Management & Application Integration with a strong product portfolio, analytical + applications, Proprietary Industry Solutions and strong services capability + \\r\\n\\r\\nStone Apple has a strong offshore presence in SE Asia with development + centers in Vietnam and Malaysia. The Company has a strong presence and networks + in Asia Pacific, Europe and United States to support their rapidly growing + MNC enterprise customer base \\r\\n\\r\\nStone Apple provides customized solutions + to meet the changing needs of enterprises globally. From leading industry + methodologies to in-house proven models, Stone Apple collaborates with their + customers to deliver tangible business results that impact their bottom line.\",\n + \ \"id\": 772044,\n \"industries\": {\n \"_total\": + 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": + \"Information Technology & Services\"\n }]\n },\n \"name\": + \"Stone Apple Solutions\"\n },\n {\n \"description\": \"iSquare + S.A. is the Apple Authorised Distributor of Greece and Cyprus since September + 2010. iSquare is distributing Apple products but also plans, implements and + provides intergrated solutions, based on the innovative Apple products and + technology. iSquare's strategic goal is to increase the use of Apple products + among the Greek consumers, but also to provide users the ultimate Apple experience.\\r\\n\\r\\niSquare + creates and provides a complete ecosystem for Apple products and services, + aiming to bring Greek customers closer to Apple's philosophy. In order to + do that, iSquare:\\r\\n\\r\\n- Creates a wide network of POS (Points Of Sales) + that spreads throughout Greece and Cyprus\\r\\n\\r\\n- Develops its relations + with major retail chains in order to promote Apple products to a wide range + of customers\\r\\n\\r\\n- Creates a unique network of stores exclusively for + Apple products, always in line with the high standards of \\r\\n Apple Premium + Reseller program\\r\\n\\r\\n- Invests on continuous and in depth training + of the sales network in order to provide the best before and after sale \\r\\n + \ support, according to Apple's and iSquare's high standards\\r\\n\\r\\n- + Focuses on the crucial sector of Education\\r\\n\\r\\n- Constantly works to + improve the support of Apple products and solutions\\r\\n\\r\\n- Completes + Apple's ecosystem as the distributor of software and peripherals from well + known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, + iSquare aspires to bring the Apple products at the stature they deserve within + the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\": + {\n \"_total\": 1,\n \"values\": [{\n \"code\": + \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n + \ \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n + \ },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i + Servis) je autorizirani Apple partner za prodaju, servis i podrÅ¡ku.\\r\\n\\r\\nFilex + je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapreÄ\x91ujemo + prepoznatljivost Apple tehnologija prezentirajuÄ\x87i upotrebnu vrijednost + Apple rjeÅ¡enja, na domaÄ\x87em i regionalnom tržiÅ¡tu.\\r\\n\\r\\nNaÅ¡ fokus + nije iskljuÄ\x8Divo na tehnologijama veÄ\x87 kako te tehnologije podrediti + potrebama korisnika. Sukladno tome, Filex nije samo joÅ¡ jedna u nizu trgovina + u koju Ä\x87ete doÄ\x87i \\\"pokupiti\\\" svoj Apple ureÄ\x91aj, veÄ\x87 mjesto + na kojem Ä\x87ete postavljati pitanja, razgovarati i diskutirati te na kraju + izaÄ\x87i sa rjeÅ¡enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte + nas preko naÅ¡eg Internet Store-a (www.filex.hr), ili nam piÅ¡ite na prodaja@filx.hr + ili servis@filex.hr.\\r\\nI svakako nam se pridružite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-DuÄ\x87an-i-Servis/131194173598671\\r\\n\\r\\nVaÅ¡e + zadovoljstvo naÅ¡a je misija!\",\n \"id\": 2303504,\n \"industries\": + {\n \"_total\": 1,\n \"values\": [{\n \"code\": + \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n + \ \"name\": \"Filex Apple Store & Support\",\n \"specialties\": + {\n \"_total\": 4,\n \"values\": [\n \"Apple + Store\",\n \"Apple PodrÅ¡ka i Servis\",\n \"Apple RjeÅ¡enja\",\n + \ \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": + \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. + AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als + de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over + Apple met zorg en proberen u zo goed mogelijk in te lichten als Apple-Fan + in Vlaanderen. Dagelijks circuleren er duizenden geruchten over Apple in het + algemeen, onze taak is deze te bundelen en u mee te delen.\\r\\n\\r\\nDit + doen we met veel liefde voor de verschillende producten en voor Apple in het + algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben + voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n + \ \"industries\": {\n \"_total\": 1,\n \"values\": + [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n + \ }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n + \ \"specialties\": {\n \"_total\": 4,\n \"values\": + [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n + \ \"mac\"\n ]\n }\n },\n {\n \"description\": + \"OGGO est une société de conseils et solutions Apple Macintosh basée à + Genève, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos + services en un coup d'oeil :\\r\\n\\r\\n// Réparations\\r\\n// Optimisations + matérielles\\r\\n// Contrats de maintenance\\r\\n// Dépannage sur site\\r\\n// + Interventions urgentes\\r\\n// Maintenance\\r\\n// Aide à l'achat\\r\\n// + Formations\",\n \"id\": 2260437,\n \"industries\": {\n \"_total\": + 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": + \"Information Technology & Services\"\n }]\n },\n \"name\": + \"OGGO - Services Apple Macintosh\",\n \"specialties\": {\n \"_total\": + 7,\n \"values\": [\n \"Consulting & conseils Apple Macintosh\",\n + \ \"Support Apple Macintosh\",\n \"Maintenance Mac OS + X Server\",\n \"Dépannage Mac OS X\",\n \"Installation + Mac OS X Server\",\n \"Interventions Apple Macintosh\",\n \"Formation + Apple Macintosh\"\n ]\n }\n },\n {\n \"description\": + \"Apple-Crumble provides sound advice, sales and support for all apple mac + products and related peripherals including external hard drives, printers, + scanners and both apple and 3rd party software. Apple-Crumble are also experts + in troubleshooting, repair and maintenance. Our staff are apple trained and + certified with over 15 years experience.\\r\\n\\r\\nAll work is guaranteed + and all enquiries are welcome.\\r\\n\\r\\nWe are obviously very \\u2018pro\\u2019 + apple and firmly believe that once you go mac you never go back!\\r\\n\\r\\nFor + your convenience Apple-Crumble have our own workshop and offices with free + parking in Penzance, Cornwall so that you have the extra peace of mind knowing + that your equipment is being serviced in a clean and safe environment. You + may also view, demo and purchase new hardware or add-ons, as well as discussing + tailor-made options for you and/or your business.\\r\\n\\r\\nApple-Crumble\\u2019s + service extends to on-site visits for emergency or contract call-outs, as + well as delivery and installation of new products and systems. We cover Penzance, + Falmouth, Helston and the Lizard, St Ives, Hayle, Truro, Camborne, Redruth, + and all surrounding areas including north Cornwall and Devon\\r\\n\\r\\nIn + most cases it is safer and more cost effective to bring your hardware to us + as we are geared up for any static or time delay issues, but it is very rare + that we cannot provide a solution, wherever you may be!\",\n \"id\": + 1049054,\n \"industries\": {\n \"_total\": 1,\n \"values\": + [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n + \ }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n + \ },\n \"numResults\": 8450\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index 4e27e3e3..2e7e4ace 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -1,156 +1,80 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?keywords=apple - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/company-search?keywords=apple + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="xtc6RIIOpDj7AANJ9VyIXibv4YhcM3gxMUg6OewBSo", oauth_signature="8ShrnvC9fxh1tU3YNEjF4l%2Fhrho%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="xtc6RIIOpDj7AANJ9VyIXibv4YhcM3gxMUg6OewBSo", + oauth_signature="8ShrnvC9fxh1tU3YNEjF4l%2Fhrho%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - 5LR8OTP90S - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:32 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "companies": { - "_count": 10, - "_start": 0, - "_total": 8450, - "values": [ - { - "id": 162479, - "name": "Apple" - }, - { - "id": 19271, - "name": "Apple Vacations" - }, - { - "id": 778626, - "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" - }, - { - "id": 112136, - "name": "Apple & Associates" - }, - { - "id": 772044, - "name": "Stone Apple Solutions" - }, - { - "id": 2135525, - "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" - }, - { - "id": 2303504, - "name": "Filex Apple Store & Support" - }, - { - "id": 2419290, - "name": "Apple Nieuws Vlaanderen" - }, - { - "id": 2260437, - "name": "OGGO - Services Apple Macintosh" - }, - { - "id": 1049054, - "name": "Apple Crumble" - } - ] - }, - "facets": { - "_total": 1, - "values": [{ - "buckets": { - "_total": 10, - "values": [ - { - "code": "us:0", - "count": 2511, - "name": "United States", - "selected": false - }, - { - "code": "gb:0", - "count": 702, - "name": "United Kingdom", - "selected": false - }, - { - "code": "us:84", - "count": 322, - "name": "San Francisco Bay Area", - "selected": false - }, - { - "code": "us:70", - "count": 285, - "name": "Greater New York City Area", - "selected": false - }, - { - "code": "nl:0", - "count": 284, - "name": "Netherlands", - "selected": false - }, - { - "code": "ca:0", - "count": 266, - "name": "Canada", - "selected": false - }, - { - "code": "au:0", - "count": 195, - "name": "Australia", - "selected": false - }, - { - "code": "in:0", - "count": 186, - "name": "India", - "selected": false - }, - { - "code": "it:0", - "count": 177, - "name": "Italy", - "selected": false - }, - { - "code": "us:49", - "count": 173, - "name": "Greater Los Angeles Area", - "selected": false - } - ] - }, - "code": "location", - "name": "Location" - }] - }, - "numResults": 8450 - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n + \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": + \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n + \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": + \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n + \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + Support\"\n },\n {\n \"id\": 2419290,\n \"name\": + \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n + \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": + {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco + Bay Area\",\n \"selected\": false\n },\n {\n + \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"Greater New York City Area\",\n \"selected\": false\n },\n + \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + \ \"name\": \"Netherlands\",\n \"selected\": false\n + \ },\n {\n \"code\": \"ca:0\",\n \"count\": + 266,\n \"name\": \"Canada\",\n \"selected\": false\n + \ },\n {\n \"code\": \"au:0\",\n \"count\": + 195,\n \"name\": \"Australia\",\n \"selected\": false\n + \ },\n {\n \"code\": \"in:0\",\n \"count\": + 186,\n \"name\": \"India\",\n \"selected\": false\n + \ },\n {\n \"code\": \"it:0\",\n \"count\": + 177,\n \"name\": \"Italy\",\n \"selected\": false\n + \ },\n {\n \"code\": \"us:49\",\n \"count\": + 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": + false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": + \"Location\"\n }]\n },\n \"numResults\": 8450\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index deafa4f1..ff4c8b41 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -1,156 +1,80 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?keywords=apple - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/company-search?keywords=apple + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="8HvACp7Bnl1RHEamMoOAgSExAIsa0ZmPg38voXltI", oauth_signature="vU6TKCCBvu783h%2B0diQLZkcBKb8%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="8HvACp7Bnl1RHEamMoOAgSExAIsa0ZmPg38voXltI", + oauth_signature="vU6TKCCBvu783h%2B0diQLZkcBKb8%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - XPJE34FJFO - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:33 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "companies": { - "_count": 10, - "_start": 0, - "_total": 8450, - "values": [ - { - "id": 162479, - "name": "Apple" - }, - { - "id": 19271, - "name": "Apple Vacations" - }, - { - "id": 778626, - "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" - }, - { - "id": 112136, - "name": "Apple & Associates" - }, - { - "id": 772044, - "name": "Stone Apple Solutions" - }, - { - "id": 2135525, - "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" - }, - { - "id": 2303504, - "name": "Filex Apple Store & Support" - }, - { - "id": 2419290, - "name": "Apple Nieuws Vlaanderen" - }, - { - "id": 2260437, - "name": "OGGO - Services Apple Macintosh" - }, - { - "id": 1049054, - "name": "Apple Crumble" - } - ] - }, - "facets": { - "_total": 1, - "values": [{ - "buckets": { - "_total": 10, - "values": [ - { - "code": "us:0", - "count": 2511, - "name": "United States", - "selected": false - }, - { - "code": "gb:0", - "count": 702, - "name": "United Kingdom", - "selected": false - }, - { - "code": "us:84", - "count": 322, - "name": "San Francisco Bay Area", - "selected": false - }, - { - "code": "us:70", - "count": 285, - "name": "Greater New York City Area", - "selected": false - }, - { - "code": "nl:0", - "count": 284, - "name": "Netherlands", - "selected": false - }, - { - "code": "ca:0", - "count": 266, - "name": "Canada", - "selected": false - }, - { - "code": "au:0", - "count": 195, - "name": "Australia", - "selected": false - }, - { - "code": "in:0", - "count": 186, - "name": "India", - "selected": false - }, - { - "code": "it:0", - "count": 177, - "name": "Italy", - "selected": false - }, - { - "code": "us:49", - "count": 173, - "name": "Greater Los Angeles Area", - "selected": false - } - ] - }, - "code": "location", - "name": "Location" - }] - }, - "numResults": 8450 - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n + \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": + \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n + \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": + \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n + \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + Support\"\n },\n {\n \"id\": 2419290,\n \"name\": + \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n + \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": + {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco + Bay Area\",\n \"selected\": false\n },\n {\n + \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"Greater New York City Area\",\n \"selected\": false\n },\n + \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + \ \"name\": \"Netherlands\",\n \"selected\": false\n + \ },\n {\n \"code\": \"ca:0\",\n \"count\": + 266,\n \"name\": \"Canada\",\n \"selected\": false\n + \ },\n {\n \"code\": \"au:0\",\n \"count\": + 195,\n \"name\": \"Australia\",\n \"selected\": false\n + \ },\n {\n \"code\": \"in:0\",\n \"count\": + 186,\n \"name\": \"India\",\n \"selected\": false\n + \ },\n {\n \"code\": \"it:0\",\n \"count\": + 177,\n \"name\": \"Italy\",\n \"selected\": false\n + \ },\n {\n \"code\": \"us:49\",\n \"count\": + 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": + false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": + \"Location\"\n }]\n },\n \"numResults\": 8450\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index e4fa5418..56b50f67 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -1,156 +1,80 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?facets=industry&keywords=apple - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/company-search?facets=industry&keywords=apple + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="FU07WVy5LyepRG8O99eNUI0fqIxdghVO9gXhSQAOA", oauth_signature="51O%2BsP4hpjq93vwrFm2zrox0xfI%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="FU07WVy5LyepRG8O99eNUI0fqIxdghVO9gXhSQAOA", + oauth_signature="51O%2BsP4hpjq93vwrFm2zrox0xfI%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631653", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - G21FIZ5M8V - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:33 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "companies": { - "_count": 10, - "_start": 0, - "_total": 8450, - "values": [ - { - "id": 162479, - "name": "Apple" - }, - { - "id": 19271, - "name": "Apple Vacations" - }, - { - "id": 778626, - "name": "Big Apple Holdings, Inc. dba Big Apple International Realty" - }, - { - "id": 112136, - "name": "Apple & Associates" - }, - { - "id": 772044, - "name": "Stone Apple Solutions" - }, - { - "id": 2135525, - "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" - }, - { - "id": 2303504, - "name": "Filex Apple Store & Support" - }, - { - "id": 2419290, - "name": "Apple Nieuws Vlaanderen" - }, - { - "id": 2260437, - "name": "OGGO - Services Apple Macintosh" - }, - { - "id": 1049054, - "name": "Apple Crumble" - } - ] - }, - "facets": { - "_total": 1, - "values": [{ - "buckets": { - "_total": 10, - "values": [ - { - "code": "96", - "count": 2062, - "name": "Information Technology and Services", - "selected": false - }, - { - "code": "4", - "count": 1031, - "name": "Computer Software", - "selected": false - }, - { - "code": "6", - "count": 472, - "name": "Internet", - "selected": false - }, - { - "code": "3", - "count": 415, - "name": "Computer Hardware", - "selected": false - }, - { - "code": "80", - "count": 348, - "name": "Marketing and Advertising", - "selected": false - }, - { - "code": "24", - "count": 312, - "name": "Consumer Electronics", - "selected": false - }, - { - "code": "27", - "count": 206, - "name": "Retail", - "selected": false - }, - { - "code": "109", - "count": 185, - "name": "Computer Games", - "selected": false - }, - { - "code": "8", - "count": 171, - "name": "Telecommunications", - "selected": false - }, - { - "code": "126", - "count": 164, - "name": "Media Production", - "selected": false - } - ] - }, - "code": "industry", - "name": "Industry" - }] - }, - "numResults": 8450 - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n + \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": + \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n + \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": + \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n + \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + Support\"\n },\n {\n \"id\": 2419290,\n \"name\": + \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n + \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": + {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \"96\",\n \"count\": 2062,\n \"name\": \"Information + Technology and Services\",\n \"selected\": false\n },\n + \ {\n \"code\": \"4\",\n \"count\": 1031,\n + \ \"name\": \"Computer Software\",\n \"selected\": false\n + \ },\n {\n \"code\": \"6\",\n \"count\": + 472,\n \"name\": \"Internet\",\n \"selected\": false\n + \ },\n {\n \"code\": \"3\",\n \"count\": + 415,\n \"name\": \"Computer Hardware\",\n \"selected\": + false\n },\n {\n \"code\": \"80\",\n \"count\": + 348,\n \"name\": \"Marketing and Advertising\",\n \"selected\": + false\n },\n {\n \"code\": \"24\",\n \"count\": + 312,\n \"name\": \"Consumer Electronics\",\n \"selected\": + false\n },\n {\n \"code\": \"27\",\n \"count\": + 206,\n \"name\": \"Retail\",\n \"selected\": false\n + \ },\n {\n \"code\": \"109\",\n \"count\": + 185,\n \"name\": \"Computer Games\",\n \"selected\": + false\n },\n {\n \"code\": \"8\",\n \"count\": + 171,\n \"name\": \"Telecommunications\",\n \"selected\": + false\n },\n {\n \"code\": \"126\",\n \"count\": + 164,\n \"name\": \"Media Production\",\n \"selected\": + false\n }\n ]\n },\n \"code\": \"industry\",\n \"name\": + \"Industry\"\n }]\n },\n \"numResults\": 8450\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index dd4ca251..d5ef708e 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -1,136 +1,74 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://api.linkedin.com:443/v1/company-search?count=5&keywords=apple&start=5 - body: - headers: - x-li-format: +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/company-search?count=5&keywords=apple&start=5 + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: - json - authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="UCRIU2SBembgaUTMw9aBAK0tCDnDuxPG4GzClCmcVQ", oauth_signature="46tFOgfxDKiVNID1XIHrpoAs7zA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", oauth_version="1.0" - user-agent: + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="UCRIU2SBembgaUTMw9aBAK0tCDnDuxPG4GzClCmcVQ", + oauth_signature="46tFOgfxDKiVNID1XIHrpoAs7zA%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631654", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + User-Agent: - OAuth gem v0.4.7 - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - x-li-request-id: + headers: + X-Li-Request-Id: - YMZX3QW2A1 - x-li-format: + X-Li-Format: - json - date: + Date: - Wed, 10 Apr 2013 22:07:33 GMT - vary: - - "*" - server: + Vary: + - ! '*' + Server: - Apache-Coyote/1.1 - content-type: + Content-Type: - application/json;charset=UTF-8 - transfer-encoding: + Transfer-Encoding: - chunked - body: |- - { - "companies": { - "_count": 5, - "_start": 5, - "_total": 8450, - "values": [ - { - "id": 2135525, - "name": "iSquare - Apple Authorized Distributor in Greece & Cyprus" - }, - { - "id": 2303504, - "name": "Filex Apple Store & Support" - }, - { - "id": 2419290, - "name": "Apple Nieuws Vlaanderen" - }, - { - "id": 2260437, - "name": "OGGO - Services Apple Macintosh" - }, - { - "id": 1049054, - "name": "Apple Crumble" - } - ] - }, - "facets": { - "_total": 1, - "values": [{ - "buckets": { - "_total": 10, - "values": [ - { - "code": "us:0", - "count": 2511, - "name": "United States", - "selected": false - }, - { - "code": "gb:0", - "count": 702, - "name": "United Kingdom", - "selected": false - }, - { - "code": "us:84", - "count": 322, - "name": "San Francisco Bay Area", - "selected": false - }, - { - "code": "us:70", - "count": 285, - "name": "Greater New York City Area", - "selected": false - }, - { - "code": "nl:0", - "count": 284, - "name": "Netherlands", - "selected": false - }, - { - "code": "ca:0", - "count": 266, - "name": "Canada", - "selected": false - }, - { - "code": "au:0", - "count": 195, - "name": "Australia", - "selected": false - }, - { - "code": "in:0", - "count": 186, - "name": "India", - "selected": false - }, - { - "code": "it:0", - "count": 177, - "name": "Italy", - "selected": false - }, - { - "code": "us:49", - "count": 173, - "name": "Greater Los Angeles Area", - "selected": false - } - ] - }, - "code": "location", - "name": "Location" - }] - }, - "numResults": 8450 - } - http_version: "1.1" + body: + encoding: UTF-8 + string: ! "{\n \"companies\": {\n \"_count\": 5,\n \"_start\": 5,\n \"_total\": + 8450,\n \"values\": [\n {\n \"id\": 2135525,\n \"name\": + \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n + \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + Support\"\n },\n {\n \"id\": 2419290,\n \"name\": + \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n + \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": + {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n + \ \"selected\": false\n },\n {\n \"code\": + \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco + Bay Area\",\n \"selected\": false\n },\n {\n + \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"Greater New York City Area\",\n \"selected\": false\n },\n + \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + \ \"name\": \"Netherlands\",\n \"selected\": false\n + \ },\n {\n \"code\": \"ca:0\",\n \"count\": + 266,\n \"name\": \"Canada\",\n \"selected\": false\n + \ },\n {\n \"code\": \"au:0\",\n \"count\": + 195,\n \"name\": \"Australia\",\n \"selected\": false\n + \ },\n {\n \"code\": \"in:0\",\n \"count\": + 186,\n \"name\": \"India\",\n \"selected\": false\n + \ },\n {\n \"code\": \"it:0\",\n \"count\": + 177,\n \"name\": \"Italy\",\n \"selected\": false\n + \ },\n {\n \"code\": \"us:49\",\n \"count\": + 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": + false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": + \"Location\"\n }]\n },\n \"numResults\": 8450\n}" + http_version: '1.1' + recorded_at: Tue, 04 Jun 2013 03:42:37 GMT +recorded_with: VCR 2.5.0 From 6c0f8ac3d75f9f4be83e94fbe69c3fd6f0cff17a Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 6 Aug 2013 08:32:22 -0700 Subject: [PATCH 021/117] Fixing issue #166 --- lib/linked_in/api/query_methods.rb | 6 +++--- spec/cases/api_spec.rb | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index b318e1c0..d5088022 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -44,8 +44,8 @@ def group_memberships(options = {}) end def shares(options={}) - path = "#{person_path(options)}/network/updates?type=SHAR&scope=self" - simple_query(path, options) + path = "#{person_path(options)}/network/updates" + simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) end def share_comments(update_key, options={}) @@ -89,7 +89,7 @@ def person_path(options) def company_path(options) path = "/companies" - + if domain = options.delete(:domain) path += "?email-domain=#{CGI.escape(domain)}" elsif id = options.delete(:id) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index cce90346..ba412a07 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -63,6 +63,12 @@ response.code.should == "201" end + it "returns the shares for a person" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates?type=SHAR&scope=self&after=1234&count=35").to_return( + :body => "{}") + client.shares(:after => 1234, :count => 35) + end + it "should be able to comment on network update" do stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return( :body => "", :status => 201) From 4719b64a6320003d10a3a0857c2eba2c216ed529 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 6 Aug 2013 08:35:09 -0700 Subject: [PATCH 022/117] Version bump to 0.4.2 to fix issue with updates on networks --- lib/linked_in/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 416659c0..406591c3 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -3,7 +3,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 MINOR = 4 - PATCH = 1 + PATCH = 2 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From ee417df5d905cf82af894fc03895c0b9c12eeed1 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Sun, 11 Aug 2013 23:50:44 -0400 Subject: [PATCH 023/117] Updated field references to "educations" "education" isn't a valid field name. Specifying it will yield an error from LinkedIn: "Unknown field {education} in resource {Person}" --- lib/linkedin.rb | 2 +- spec/cases/linkedin_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/linkedin.rb b/lib/linkedin.rb index e6137897..cd3524bf 100644 --- a/lib/linkedin.rb +++ b/lib/linkedin.rb @@ -10,7 +10,7 @@ class << self # LinkedIn.configure do |config| # config.token = 'consumer_token' # config.secret = 'consumer_secret' - # config.default_profile_fields = ['education', 'positions'] + # config.default_profile_fields = ['educations', 'positions'] # end # # elsewhere diff --git a/spec/cases/linkedin_spec.rb b/spec/cases/linkedin_spec.rb index a6cd2940..af9ce004 100644 --- a/spec/cases/linkedin_spec.rb +++ b/spec/cases/linkedin_spec.rb @@ -17,21 +17,21 @@ end it "should be able to set the default profile fields" do - LinkedIn.default_profile_fields = ['education', 'positions'] + LinkedIn.default_profile_fields = ['educations', 'positions'] - LinkedIn.default_profile_fields.should == ['education', 'positions'] + LinkedIn.default_profile_fields.should == ['educations', 'positions'] end it "should be able to set the consumer token and consumer secret via a configure block" do LinkedIn.configure do |config| config.token = 'consumer_token' config.secret = 'consumer_secret' - config.default_profile_fields = ['education', 'positions'] + config.default_profile_fields = ['educations', 'positions'] end LinkedIn.token.should == 'consumer_token' LinkedIn.secret.should == 'consumer_secret' - LinkedIn.default_profile_fields.should == ['education', 'positions'] + LinkedIn.default_profile_fields.should == ['educations', 'positions'] end end From 6e5124daf2aedf14ee5a4947372d0f8fba96b9ee Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Wed, 11 Sep 2013 21:26:12 -0600 Subject: [PATCH 024/117] modified the query methods to support groups as well as nested field hashes/objects. Modified the update methods to be able to share to a group --- lib/linked_in/api/query_methods.rb | 30 ++++++++++++++++++++++++++++- lib/linked_in/api/update_methods.rb | 13 +++++++++---- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index d5088022..b2cdd419 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -43,6 +43,11 @@ def group_memberships(options = {}) simple_query(path, options) end + def group(options = {}) + path = "#{group_path(options)}" + simple_query(path, options) + end + def shares(options={}) path = "#{person_path(options)}/network/updates" simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) @@ -66,7 +71,7 @@ def simple_query(path, options={}) if options.delete(:public) path +=":public" elsif fields - path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" + path +=":(#{build_fields_params(fields)})" end headers = options.delete(:headers) || {} @@ -76,6 +81,18 @@ def simple_query(path, options={}) Mash.from_json(get(path, headers)) end + def build_fields_params(fields) + if fields.is_a?(Hash) && fields.present? + hash_array = [] + fields.each do |index, value| + hash_array << "#{index}:(#{build_fields_params(value)})" + end + hash_array.join(',') + else + fields.map{ |f| f.is_a?(Hash) ? build_fields_params(f) : f.to_s.gsub("_","-") }.join(',') + end + end + def person_path(options) path = "/people/" if id = options.delete(:id) @@ -87,6 +104,17 @@ def person_path(options) end end + def group_path(options) + path = "/groups/" + if id = options.delete(:id) + path += id + elsif url = options.delete(:url) + path += "url=#{CGI.escape(url)}" + else + path += "~" + end + end + def company_path(options) path = "/companies" diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index cbf3b96b..9e8a5576 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -9,6 +9,11 @@ def add_share(share) post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + def group_share(group_id, share) + path = "/groups/#{group_id}/posts" + post(path, share.to_json, "Content-Type" => "application/json") + end + def join_group(group_id) path = "/people/~/group-memberships/#{group_id}" body = {'membership-state' => {'code' => 'member' }} @@ -51,13 +56,13 @@ def unlike_share(network_key) def send_message(subject, body, recipient_paths) path = "/people/~/mailbox" - + message = { - 'subject' => subject, + 'subject' => subject, 'body' => body, 'recipients' => { - 'values' => recipient_paths.map do |profile_path| - { 'person' => { '_path' => "/people/#{profile_path}" } } + 'values' => recipient_paths.map do |profile_path| + { 'person' => { '_path' => "/people/#{profile_path}" } } end } } From dafbee0ac6df23a48ba615df1c69e57ad5658f4f Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 30 Sep 2013 13:07:17 -0700 Subject: [PATCH 025/117] Manually merging in changes from PR #160 --- lib/linked_in/api/query_methods.rb | 103 ++++++++++++++++------------ lib/linked_in/api/update_methods.rb | 37 ++++------ spec/cases/api_spec.rb | 18 +++++ 3 files changed, 92 insertions(+), 66 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index d5088022..7b1e68bf 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -43,6 +43,16 @@ def group_memberships(options = {}) simple_query(path, options) end + def group_profile(options) + path = group_path(options) + simple_query(path, options) + end + + def group_posts(options) + path = "#{group_path(options)}/posts" + simple_query(path, options) + end + def shares(options={}) path = "#{person_path(options)}/network/updates" simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) @@ -60,59 +70,64 @@ def share_likes(update_key, options={}) private - def simple_query(path, options={}) - fields = options.delete(:fields) || LinkedIn.default_profile_fields - - if options.delete(:public) - path +=":public" - elsif fields - path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" - end + def group_path(options) + path = "/groups" + if id = options.delete(:id) + path += "/#{id}" + end + end - headers = options.delete(:headers) || {} - params = to_query(options) - path += "?#{params}" if !params.empty? + def simple_query(path, options={}) + fields = options.delete(:fields) || LinkedIn.default_profile_fields - Mash.from_json(get(path, headers)) + if options.delete(:public) + path +=":public" + elsif fields + path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" end - def person_path(options) - path = "/people/" - if id = options.delete(:id) - path += "id=#{id}" - elsif url = options.delete(:url) - path += "url=#{CGI.escape(url)}" - else - path += "~" - end - end + headers = options.delete(:headers) || {} + params = to_query(options) + path += "?#{params}" if !params.empty? + + Mash.from_json(get(path, headers)) + end - def company_path(options) - path = "/companies" - - if domain = options.delete(:domain) - path += "?email-domain=#{CGI.escape(domain)}" - elsif id = options.delete(:id) - path += "/id=#{id}" - elsif url = options.delete(:url) - path += "/url=#{CGI.escape(url)}" - elsif name = options.delete(:name) - path += "/universal-name=#{CGI.escape(name)}" - else - path += "/~" - end + def person_path(options) + path = "/people/" + if id = options.delete(:id) + path += "id=#{id}" + elsif url = options.delete(:url) + path += "url=#{CGI.escape(url)}" + else + path += "~" end + end - def jobs_path(options) - path = "/jobs" - if id = options.delete(:id) - path += "/id=#{id}" - else - path += "/~" - end + def company_path(options) + path = "/companies" + + if domain = options.delete(:domain) + path += "?email-domain=#{CGI.escape(domain)}" + elsif id = options.delete(:id) + path += "/id=#{id}" + elsif url = options.delete(:url) + path += "/url=#{CGI.escape(url)}" + elsif name = options.delete(:name) + path += "/universal-name=#{CGI.escape(name)}" + else + path += "/~" end + end + def jobs_path(options) + path = "/jobs" + if id = options.delete(:id) + path += "/id=#{id}" + else + path += "/~" + end + end end - end end diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index cbf3b96b..0c75a50b 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -21,23 +21,11 @@ def add_job_bookmark(bookmark) post(path, body.to_json, "Content-Type" => "application/json") end - # def share(options={}) - # path = "/people/~/shares" - # defaults = { :visability => 'anyone' } - # post(path, share_to_xml(defaults.merge(options))) - # end - # def update_comment(network_key, comment) path = "/people/~/network/updates/key=#{network_key}/update-comments" body = {'comment' => comment} post(path, body.to_json, "Content-Type" => "application/json") end - # - # def update_network(message) - # path = "/people/~/person-activities" - # post(path, network_update_to_xml(message)) - # end - # def like_share(network_key) path = "/people/~/network/updates/key=#{network_key}/is-liked" @@ -51,24 +39,29 @@ def unlike_share(network_key) def send_message(subject, body, recipient_paths) path = "/people/~/mailbox" - + message = { - 'subject' => subject, + 'subject' => subject, 'body' => body, 'recipients' => { - 'values' => recipient_paths.map do |profile_path| - { 'person' => { '_path' => "/people/#{profile_path}" } } + 'values' => recipient_paths.map do |profile_path| + { 'person' => { '_path' => "/people/#{profile_path}" } } end } } post(path, message.to_json, "Content-Type" => "application/json") end - # - # def clear_status - # path = "/people/~/current-status" - # delete(path).code - # end - # + + def post_group_discussion(group_id, discussion) + path = "/groups/#{group_id}/posts" + + discussion_post = { + 'title' => discussion['title'], + 'summary' => discussion['summary'] + } + + post(path, discussion_post.to_json, "Content-Type" => "application/json") + end end diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index ba412a07..37d21149 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -183,6 +183,24 @@ response.code.should == "201" end + it "should be able to list a group profile" do + stub_request(:get, "https://api.linkedin.com/v1/groups/123").to_return(:body => '{"id": "123"}') + response = client.group_profile(:id => 123) + response.id.should == '123' + end + + it "should be able to list group posts" do + stub_request(:get, "https://api.linkedin.com/v1/groups/123/posts").to_return(:body => '{"id": "123"}') + response = client.group_posts(:id => 123) + response.id.should == '123' + end + + it 'should be able to post a discussion to a group' do + stub_request(:post, "https://api.linkedin.com/v1/groups/123/posts").to_return(:body => "", :status => 201) + response = client.post_group_discussion(123, {'title' => 'New Discussion', 'summary' => 'New Summary'}) + response.body.should == nil + response.code.should == '201' + end end context "Errors" do From 6c755e802706425a3603b88c082b393706700572 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 30 Sep 2013 13:08:31 -0700 Subject: [PATCH 026/117] Version bump to 0.4.3 to add more group functionality as well as fixing references to educations --- lib/linked_in/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 406591c3..79321425 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -3,7 +3,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 MINOR = 4 - PATCH = 2 + PATCH = 3 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From abbdfbba153bce3c72fc7307d5d335fcd3d1ad53 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Mon, 7 Oct 2013 18:54:36 +0200 Subject: [PATCH 027/117] update the travis image --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index e6edd37d..6717a757 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,7 @@ Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). Heavily inspired by [John Nunemaker's](http://github.com/jnunemaker) [Twitter gem](http://github.com/jnunemaker/twitter), the LinkedIn gem provides an easy-to-use wrapper for LinkedIn's Oauth/XML APIs. -Travis CI : [![Build Status](https://secure.travis-ci.org/pengwynn/linkedin.png)](http://travis-ci.org/pengwynn/linkedin) +Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)](http://travis-ci.org/hexgnu/linkedin) ## Installation From 9a07a19798f5b9d806f4f2e318ed3c43fb50fb69 Mon Sep 17 00:00:00 2001 From: Ian Choi Date: Fri, 2 Aug 2013 12:09:08 -0400 Subject: [PATCH 028/117] Add support to company updates, company update comments and linkes, company statistic --- lib/linked_in/api/query_methods.rb | 20 ++++++++++++++++++++ spec/cases/api_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 7b1e68bf..e93e7d64 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -23,6 +23,26 @@ def company(options = {}) simple_query(path, options) end + def company_updates(options={}) + path = "#{company_path(options)}/updates" + simple_query(path, options) + end + + def company_statistics(options={}) + path = "#{company_path(options)}/company-statistics" + simple_query(path, options) + end + + def company_updates_comments(update_key, options={}) + path = "#{company_path(options)}/updates/key=#{update_key}/update-comments" + simple_query(path, options) + end + + def company_updates_likes(update_key, options={}) + path = "#{company_path(options)}/updates/key=#{update_key}/likes" + simple_query(path, options) + end + def job(options = {}) path = jobs_path(options) simple_query(path, options) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 37d21149..210c4397 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -140,6 +140,26 @@ data.locations.all[0].address.city.should == "Seattle" data.locations.all[0].is_headquarters.should == true end + + it "should be able to view company_updates" do + stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates").to_return(:body => "{}") + client.company_updates(:id => 1586).should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view company_statistic" do + stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/company-statistics").to_return(:body => "{}") + client.company_statistics(:id => 1586).should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view company updates comments" do + stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/update-comments").to_return(:body => "{}") + client.company_updates_comments("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash) + end + + it "should be able to view company updates likes" do + stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/likes").to_return(:body => "{}") + client.company_updates_likes("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash) + end end context "Job API" do From 117c1a60c1e5658b3687ae92187a47b209edb846 Mon Sep 17 00:00:00 2001 From: "Michael Hauser-Raspe (home)" Date: Mon, 14 Oct 2013 16:10:39 +0100 Subject: [PATCH 029/117] Adding gemmaros' commits to hexgnu's current branch --- lib/linked_in/api/update_methods.rb | 6 ++++++ spec/cases/api_spec.rb | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 0c75a50b..71996279 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -9,6 +9,12 @@ def add_share(share) post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + def add_company_share(company_id, share) + path = "/companies/#{company_id}/shares" + defaults = {:visibility => {:code => "anyone"}} + post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") + end + def join_group(group_id) path = "/people/~/group-memberships/#{group_id}" body = {'membership-state' => {'code' => 'member' }} diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 210c4397..e96ef970 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -63,6 +63,13 @@ response.code.should == "201" end + it "should be able to share a new company status" do + stub_request(:post, "https://api.linkedin.com/v1/companies/123456/shares").to_return(:body => "", :status => 201) + response = client.add_company_share("123456", { :comment => "Testing, 1, 2, 3" }) + response.body.should == nil + response.code.should == "201" + end + it "returns the shares for a person" do stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates?type=SHAR&scope=self&after=1234&count=35").to_return( :body => "{}") @@ -129,6 +136,11 @@ client.company(:domain => 'acme.com').should be_an_instance_of(LinkedIn::Mash) end + it "should be able to view a user's company pages" do + stub_request(:get, "https://api.linkedin.com/v1/companies?is-company-admin=true").to_return(:body => "{}") + client.company(:is_admin => 'true').should be_an_instance_of(LinkedIn::Mash) + end + it "should load correct company data" do client.company(:id => 1586).name.should == "Amazon" From 0f45908e00cc85d79bebb0deeb0ff15fa3ddddb5 Mon Sep 17 00:00:00 2001 From: "Michael Hauser-Raspe (home)" Date: Mon, 14 Oct 2013 16:45:40 +0100 Subject: [PATCH 030/117] added follow company requests --- lib/linked_in/api/update_methods.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 71996279..34d99e55 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -15,6 +15,17 @@ def add_company_share(company_id, share) post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + def follow_company(company_id) + path = "/people/~/following/companies" + body = {:company => {:id =>company_id}} + post(path, body.to_json, "Content-Type" => "application/json") + end + + def unfollow_company(company_id) + path = "/people/~/following/companies/id=#{company_id}" + delete(path) + end + def join_group(group_id) path = "/people/~/group-memberships/#{group_id}" body = {'membership-state' => {'code' => 'member' }} From 016fe46a5d882117492ea58b6b3590daa95cfcc9 Mon Sep 17 00:00:00 2001 From: "Michael Hauser-Raspe (home)" Date: Mon, 14 Oct 2013 17:27:59 +0100 Subject: [PATCH 031/117] bugfix --- lib/linked_in/api/update_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 34d99e55..760d73bb 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -17,7 +17,7 @@ def add_company_share(company_id, share) def follow_company(company_id) path = "/people/~/following/companies" - body = {:company => {:id =>company_id}} + body = {:id => company_id } post(path, body.to_json, "Content-Type" => "application/json") end From 7452540f85379bcdcf4af3f55a1b7c66434231b2 Mon Sep 17 00:00:00 2001 From: "Michael Hauser-Raspe (home)" Date: Tue, 15 Oct 2013 11:18:15 +0100 Subject: [PATCH 032/117] added tests --- spec/cases/api_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index e96ef970..87ec5929 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -172,6 +172,23 @@ stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/likes").to_return(:body => "{}") client.company_updates_likes("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash) end + + it "should be able to follow a company" do + stub_request(:post, "https://api.linkedin.com/v1/people/~/following/companies").to_return(:body => "", :status => 201) + + response = client.follow_company(1586) + response.body.should == nil + response.code.should == "201" + end + + it "should be able to unfollow a company" do + stub_request(:delete, "https://api.linkedin.com/v1/people/~/following/companies/id=1586").to_return(:body => "", :status => 201) + + response = client.unfollow_company(1586) + response.body.should == nil + response.code.should == "201" + end + end context "Job API" do From 3d206aa822fefcbf121d86877203a36debe27d07 Mon Sep 17 00:00:00 2001 From: "Michael Hauser-Raspe (home)" Date: Tue, 15 Oct 2013 11:22:20 +0100 Subject: [PATCH 033/117] added missing line to query_methods --- lib/linked_in/api/query_methods.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index e93e7d64..e85bea23 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -135,6 +135,8 @@ def company_path(options) path += "/url=#{CGI.escape(url)}" elsif name = options.delete(:name) path += "/universal-name=#{CGI.escape(name)}" + elsif is_admin = options.delete(:is_admin) + path += "?is-company-admin=#{CGI.escape(is_admin)}" else path += "/~" end From 215d266198251a3f8061cfab0fa0b16fb529fb92 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 15 Oct 2013 07:29:41 -0700 Subject: [PATCH 034/117] Changing up travis to only test 2.0.0 jruby and rubinius --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0acac844..e81c47f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ rvm: - - 1.8.7 - - 1.9.2 - - 1.9.3 - - ree + - 2.0.0 + - jruby-19mode + - rbx-19mode From c5fbf0e2e8212945c8f27d34434310245ad5fdc1 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Wed, 13 Nov 2013 08:22:58 -0700 Subject: [PATCH 035/117] Fixed an issue with double ? in the query paramters --- lib/linked_in/api/query_methods.rb | 2 +- spec/cases/api_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index e85bea23..5a83e545 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -108,7 +108,7 @@ def simple_query(path, options={}) headers = options.delete(:headers) || {} params = to_query(options) - path += "?#{params}" if !params.empty? + path += "#{path.include?("?") ? "&" : "?"}#{params}" if !params.empty? Mash.from_json(get(path, headers)) end diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 87ec5929..237e7724 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -141,6 +141,11 @@ client.company(:is_admin => 'true').should be_an_instance_of(LinkedIn::Mash) end + it "should be able to page a user's company pages" do + stub_request(:get, "https://api.linkedin.com/v1/companies?is-company-admin=true&count=10&start=0").to_return(:body => "{}") + client.company(:is_admin => 'true', :count => 10, :start => 0).should be_an_instance_of(LinkedIn::Mash) + end + it "should load correct company data" do client.company(:id => 1586).name.should == "Amazon" From 4154e2501c2fdc3eb9993be1d07042da4be2dcb8 Mon Sep 17 00:00:00 2001 From: Dmitriy Karpus Date: Wed, 7 Aug 2013 16:54:27 +0300 Subject: [PATCH 036/117] Added method to get user's picture urls --- lib/linked_in/api/query_methods.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 5a83e545..106c8ad5 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -87,6 +87,12 @@ def share_likes(update_key, options={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" simple_query(path, options) end + + def picture_urls(options={}) + picture_size = options.delete(:picture_size) || 'original' + path = "#{picture_urls_path(options)}::(#{picture_size})" + simple_query(path, options) + end private @@ -142,6 +148,11 @@ def company_path(options) end end + def picture_urls_path(options) + path = person_path(options) + path += "/picture-urls" + end + def jobs_path(options) path = "/jobs" if id = options.delete(:id) From 451198c21af872be709326a3898df9a711e89f1d Mon Sep 17 00:00:00 2001 From: Dmitriy Karpus Date: Wed, 7 Aug 2013 17:11:43 +0300 Subject: [PATCH 037/117] Add tests for view picture urls --- spec/cases/api_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 237e7724..351280ef 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -19,6 +19,11 @@ stub_request(:get, "https://api.linkedin.com/v1/people/id=123").to_return(:body => "{}") client.profile(:id => 123).should be_an_instance_of(LinkedIn::Mash) end + + it "should be able to view the picture urls" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/picture-urls::(original)").to_return(:body => "{}") + client.picture_urls.should be_an_instance_of(LinkedIn::Mash) + end it "should be able to view connections" do stub_request(:get, "https://api.linkedin.com/v1/people/~/connections").to_return(:body => "{}") From c76840c8765e2e1cb12b4a74d59c9d094349e014 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 15 Nov 2013 11:24:58 -0700 Subject: [PATCH 038/117] Dont limit group posts to only title and summary The group post can also have a content field --- lib/linked_in/api/update_methods.rb | 8 +------- spec/cases/api_spec.rb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 760d73bb..0a70273e 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -71,13 +71,7 @@ def send_message(subject, body, recipient_paths) def post_group_discussion(group_id, discussion) path = "/groups/#{group_id}/posts" - - discussion_post = { - 'title' => discussion['title'], - 'summary' => discussion['summary'] - } - - post(path, discussion_post.to_json, "Content-Type" => "application/json") + post(path, discussion.to_json, "Content-Type" => "application/json") end end diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 237e7724..8927daeb 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -250,8 +250,16 @@ end it 'should be able to post a discussion to a group' do - stub_request(:post, "https://api.linkedin.com/v1/groups/123/posts").to_return(:body => "", :status => 201) - response = client.post_group_discussion(123, {'title' => 'New Discussion', 'summary' => 'New Summary'}) + expected = { + 'title' => 'New Discussion', + 'summary' => 'New Summary', + 'content' => { + "submitted-url" => "http://www.google.com" + } + } + + stub_request(:post, "https://api.linkedin.com/v1/groups/123/posts").with(:body => expected).to_return(:body => "", :status => 201) + response = client.post_group_discussion(123, expected) response.body.should == nil response.code.should == '201' end From ad732276e2b6ef24bec91b2ec51207a81a1ec738 Mon Sep 17 00:00:00 2001 From: schallereqo Date: Fri, 6 Dec 2013 23:19:43 +0200 Subject: [PATCH 039/117] Added an example for the communication API using the messages. Moved the message test spec under the right context. --- examples/communication.rb | 7 +++++++ spec/cases/api_spec.rb | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 examples/communication.rb diff --git a/examples/communication.rb b/examples/communication.rb new file mode 100644 index 00000000..4c8984ab --- /dev/null +++ b/examples/communication.rb @@ -0,0 +1,7 @@ +# AUTHENTICATE FIRST found in examples/authenticate.rb + +# client is a LinkedIn::Client + +# send a message to a person in your network. you will need to authenticate the +# user and ask for the "w_messages" permission. +response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) \ No newline at end of file diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 4b54b5df..e300859c 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -89,13 +89,6 @@ response.code.should == "201" end - it "should be able to send a message" do - stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201) - response = client.send_message("subject", "body", ["recip1", "recip2"]) - response.body.should == nil - response.code.should == "201" - end - it "should be able to like a network update" do stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). with(:body => "true").to_return(:body => "", :status => 201) @@ -270,6 +263,15 @@ end end + context "Communication API" do + it "should be able to send a message" do + stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201) + response = client.send_message("subject", "body", ["recip1", "recip2"]) + response.body.should == nil + response.code.should == "201" + end + end + context "Errors" do it "should raise AccessDeniedError when LinkedIn returns 403 status code" do stub_request(:get, "https://api.linkedin.com/v1/people-search?first-name=Javan").to_return(:body => "{}", :status => 403) From 6786c900b7eff287e07c92e3720ba5935f274d4e Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Sun, 8 Dec 2013 18:34:30 -0700 Subject: [PATCH 040/117] added nested fields back --- lib/linked_in/api/query_methods.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 106c8ad5..c1f8970f 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -87,7 +87,7 @@ def share_likes(update_key, options={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" simple_query(path, options) end - + def picture_urls(options={}) picture_size = options.delete(:picture_size) || 'original' path = "#{picture_urls_path(options)}::(#{picture_size})" @@ -109,7 +109,8 @@ def simple_query(path, options={}) if options.delete(:public) path +=":public" elsif fields - path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" + # path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" + path +=":(#{build_fields_params(fields)})" end headers = options.delete(:headers) || {} @@ -119,6 +120,18 @@ def simple_query(path, options={}) Mash.from_json(get(path, headers)) end + def build_fields_params(fields) + if fields.is_a?(Hash) && fields.present? + hash_array = [] + fields.each do |index, value| + hash_array << "#{index}:(#{build_fields_params(value)})" + end + hash_array.join(',') + else + fields.map{ |f| f.is_a?(Hash) ? build_fields_params(f) : f.to_s.gsub("_","-") }.join(',') + end + end + def person_path(options) path = "/people/" if id = options.delete(:id) From d0ea476b50d75c39e0c9b11959091ee650573c8b Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Sun, 8 Dec 2013 18:46:59 -0700 Subject: [PATCH 041/117] Removed commented out line --- lib/linked_in/api/query_methods.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index c1f8970f..2b143c02 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -109,7 +109,6 @@ def simple_query(path, options={}) if options.delete(:public) path +=":public" elsif fields - # path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})" path +=":(#{build_fields_params(fields)})" end From 80fb39da94ba8428e6a45d1074c40a123e141b46 Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Mon, 9 Dec 2013 09:22:17 -0700 Subject: [PATCH 042/117] added specs and tweaked code based on feedback --- lib/linked_in/api/query_methods.rb | 8 ++------ spec/cases/api_spec.rb | 14 +++++++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index c1f8970f..6ad6099f 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -121,12 +121,8 @@ def simple_query(path, options={}) end def build_fields_params(fields) - if fields.is_a?(Hash) && fields.present? - hash_array = [] - fields.each do |index, value| - hash_array << "#{index}:(#{build_fields_params(value)})" - end - hash_array.join(',') + if fields.is_a?(Hash) && !fields.empty? + fields.map{ |index,value| "#{index}:(#{build_fields_params(value)})" }.join(',') else fields.map{ |f| f.is_a?(Hash) ? build_fields_params(f) : f.to_s.gsub("_","-") }.join(',') end diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index e300859c..e3626c83 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -19,7 +19,7 @@ stub_request(:get, "https://api.linkedin.com/v1/people/id=123").to_return(:body => "{}") client.profile(:id => 123).should be_an_instance_of(LinkedIn::Mash) end - + it "should be able to view the picture urls" do stub_request(:get, "https://api.linkedin.com/v1/people/~/picture-urls::(original)").to_return(:body => "{}") client.picture_urls.should be_an_instance_of(LinkedIn::Mash) @@ -227,6 +227,11 @@ client.group_memberships.should be_an_instance_of(LinkedIn::Mash) end + it "should be able to parse nested fields" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,small-logo-url,short-description))").to_return(:body => "{}") + client.group_memberships(fields: [{group: ['id', 'name', 'small-logo-url', 'short-description']}]).should be_an_instance_of(LinkedIn::Mash) + end + it "should be able to join a group" do stub_request(:put, "https://api.linkedin.com/v1/people/~/group-memberships/123").to_return(:body => "", :status => 201) @@ -261,6 +266,13 @@ response.body.should == nil response.code.should == '201' end + + it "should be able to share a new group status" do + stub_request(:post, "https://api.linkedin.com/v1/groups/1/posts").to_return(:body => "", :status => 201) + response = client.group_share(1, :comment => "Testing, 1, 2, 3") + response.body.should == nil + response.code.should == "201" + end end context "Communication API" do From b52a8c4edcce0123b614c6216b2b641fbc92a3b6 Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Mon, 9 Dec 2013 15:21:36 -0700 Subject: [PATCH 043/117] removed duplicate checks in build_field_params --- lib/linked_in/api/query_methods.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 3ab46fbc..f5af1fb6 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -121,9 +121,11 @@ def simple_query(path, options={}) def build_fields_params(fields) if fields.is_a?(Hash) && !fields.empty? - fields.map{ |index,value| "#{index}:(#{build_fields_params(value)})" }.join(',') + fields.map {|index,value| "#{index}:(#{build_fields_params(value)})" }.join(',') + elsif fields.respond_to?(:each) + fields.map {|field| build_fields_params(field) }.join(',') else - fields.map{ |f| f.is_a?(Hash) ? build_fields_params(f) : f.to_s.gsub("_","-") }.join(',') + fields.to_s.gsub("_", "-") end end From 31b0a189ae6b72ebece0652df42d761270869761 Mon Sep 17 00:00:00 2001 From: Alex O'Rielly Date: Mon, 9 Dec 2013 16:33:12 -0700 Subject: [PATCH 044/117] renaming to match the other shares --- lib/linked_in/api/update_methods.rb | 10 +++++----- spec/cases/api_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index b39d515e..d0f5189c 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -15,6 +15,11 @@ def add_company_share(company_id, share) post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + def add_group_share(group_id, share) + path = "/groups/#{group_id}/posts" + post(path, share.to_json, "Content-Type" => "application/json") + end + def follow_company(company_id) path = "/people/~/following/companies" body = {:id => company_id } @@ -32,11 +37,6 @@ def join_group(group_id) put(path, body.to_json, "Content-Type" => "application/json") end - def group_share(group_id, share) - path = "/groups/#{group_id}/posts" - post(path, share.to_json, "Content-Type" => "application/json") - end - def add_job_bookmark(bookmark) path = "/people/~/job-bookmarks" body = {'job' => {'id' => bookmark}} diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index e3626c83..9bae0448 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -269,7 +269,7 @@ it "should be able to share a new group status" do stub_request(:post, "https://api.linkedin.com/v1/groups/1/posts").to_return(:body => "", :status => 201) - response = client.group_share(1, :comment => "Testing, 1, 2, 3") + response = client.add_group_share(1, :comment => "Testing, 1, 2, 3") response.body.should == nil response.code.should == "201" end From 8d58d46044230f08da77bc7f52ca2994db41d846 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 17 Dec 2013 15:46:01 -0800 Subject: [PATCH 045/117] Making the authenticate.rb example a little clearer --- examples/authenticate.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/authenticate.rb b/examples/authenticate.rb index 544e2d0f..531dfba1 100644 --- a/examples/authenticate.rb +++ b/examples/authenticate.rb @@ -3,12 +3,17 @@ # get your api keys at https://www.linkedin.com/secure/developer client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') -rtoken = client.request_token.token -rsecret = client.request_token.secret + +# If you want to use one of the scopes from linkedin you have to pass it in at this point +# You can learn more about it here: http://developer.linkedin.com/documents/authentication +request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") + +rtoken = request_token.token +rsecret = request_token.secret # to test from your desktop, open the following url in your browser # and record the pin it gives you -client.request_token.authorize_url +request_token.authorize_url => "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" # then fetch your access keys From 3699a5a58e5993d392521c1615e42cea9dffed83 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 17 Dec 2013 15:50:41 -0800 Subject: [PATCH 046/117] Cleanup of LICENSE, README and gemspec --- LICENSE | 2 +- README.markdown | 22 +++++++++++++--------- linkedin.gemspec | 8 ++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/LICENSE b/LICENSE index 5c6e9d09..1fef56d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 Wynn Netherland +Copyright (c) 2009 Wynn Netherland & Matthew Kirk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.markdown b/README.markdown index 6717a757..00ba17d0 100644 --- a/README.markdown +++ b/README.markdown @@ -1,12 +1,12 @@ # LinkedIn -Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). Heavily inspired by [John Nunemaker's](http://github.com/jnunemaker) [Twitter gem](http://github.com/jnunemaker/twitter), the LinkedIn gem provides an easy-to-use wrapper for LinkedIn's Oauth/XML APIs. +Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). The LinkedIn gem provides an easy-to-use wrapper for LinkedIn's Oauth/XML APIs. Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)](http://travis-ci.org/hexgnu/linkedin) ## Installation - [sudo] gem install linkedin + gem install linkedin ## Usage @@ -15,17 +15,21 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)]( LinkedIn's API uses Oauth for authentication. Luckily, the LinkedIn gem hides most of the gory details from you. ```ruby -require 'rubygems' require 'linkedin' # get your api keys at https://www.linkedin.com/secure/developer client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') -rtoken = client.request_token.token -rsecret = client.request_token.secret + +# If you want to use one of the scopes from linkedin you have to pass it in at this point +# You can learn more about it here: http://developer.linkedin.com/documents/authentication +request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") + +rtoken = request_token.token +rsecret = request_token.secret # to test from your desktop, open the following url in your browser # and record the pin it gives you -client.request_token.authorize_url +request_token.authorize_url => "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" # then fetch your access keys @@ -33,7 +37,7 @@ client.authorize_from_request(rtoken, rsecret, pin) => ["OU812", "8675309"] # <= save these for future requests # or authorize from previously fetched access keys -client.authorize_from_access("OU812", "8675309") +c.authorize_from_access("OU812", "8675309") # you're now free to move about the cabin, call any API method ``` @@ -50,7 +54,6 @@ client.profile(:id => 'gNma67_AdI') client.profile(:url => 'http://www.linkedin.com/in/netherland') ``` - More examples in the [examples folder](http://github.com/pengwynn/linkedin/blob/master/examples). For a nice example on using this in a [Rails App](http://pivotallabs.com/users/will/blog/articles/1096-linkedin-gem-for-a-web-app). @@ -70,6 +73,7 @@ If you want to play with the LinkedIn api without using the gem, have a look at * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. +* Make sure your test doesn't just check of instance of LinkedIn::Mash :smile:. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) @@ -77,4 +81,4 @@ If you want to play with the LinkedIn api without using the gem, have a look at ## Copyright -Copyright (c) 2009-11 [Wynn Netherland](http://wynnnetherland.com). See LICENSE for details. +Copyright (c) 2013-Present [Matt Kirk](http://matthewkirk.com) 2009-11 [Wynn Netherland](http://wynnnetherland.com). See LICENSE for details. diff --git a/linkedin.gemspec b/linkedin.gemspec index 91f69fd6..86141b91 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -12,11 +12,11 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'simplecov', '~> 0.7' gem.add_development_dependency 'vcr', '~> 2.5' gem.add_development_dependency 'webmock', '~> 1.11' - gem.authors = ["Wynn Netherland", "Josh Kalderimis"] - gem.description = %q{Ruby wrapper for the LinkedIn API} - gem.email = ['wynn.netherland@gmail.com', 'josh.kalderimis@gmail.com'] + gem.authors = ['Matthew Kirk', 'Wynn Netherland', 'Josh Kalderimis'] + gem.description = 'Ruby wrapper for the LinkedIn API' + gem.email = ['meteor.kirk@gmail.com', 'wynn.netherland@gmail.com', 'josh.kalderimis@gmail.com'] gem.files = `git ls-files`.split("\n") - gem.homepage = 'http://github.com/pengwynn/linkedin' + gem.homepage = 'http://github.com/hexgnu/linkedin' gem.name = 'linkedin' gem.require_paths = ['lib'] gem.summary = gem.description From cbba2b4cbb8d97b387b4623cdeb88611e7800523 Mon Sep 17 00:00:00 2001 From: Wynn Netherland Date: Fri, 10 Jan 2014 14:39:41 -0600 Subject: [PATCH 047/117] Update LICENSE Making it clear the license is MIT as a followup to an email inquiry. /cc @hexgnu --- LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index 1fef56d4..6b66ebed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +The MIT License (MIT) + Copyright (c) 2009 Wynn Netherland & Matthew Kirk Permission is hereby granted, free of charge, to any person obtaining From fd148568c6bd86746e5569dad376376423efdbb6 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Sat, 11 Jan 2014 14:20:25 -0800 Subject: [PATCH 048/117] Version bump and changelog changed --- changelog.markdown | 17 +++++++++++++---- lib/linked_in/version.rb | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/changelog.markdown b/changelog.markdown index 75bb3582..41d1c9fc 100644 --- a/changelog.markdown +++ b/changelog.markdown @@ -1,20 +1,29 @@ # Changelog +## 0.4.4 - Jan 11, 2014 + +* Group share add +* Readme updates + +## 0.4.3 + +## 0.4.2 + +## 0.4.1 + ## 0.4.0 - May 30, 2013 * Add capability to ask for desired permissions from linked in api * Add option to specify a proxy * Bump hashie version * fix the permission param passing -* fix to be able to pass the permission scope +* fix to be able to pass the permission scope * Manipulating comments/likes for network_updates ('shares') -* Methods to work with comments/likes for share +* Methods to work with comments/likes for share * Added a method to get a user's shares * Added current user's shares as an option (client.shares) * Readme Typos - - ## 0.2.x - March x, 2010 * Removed Crack as a dependency, Nokogiri FTW diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 79321425..a63ca769 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -3,7 +3,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 MINOR = 4 - PATCH = 3 + PATCH = 4 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From 764b50e7e2df362f20a1dce62d85bd6d2078aa3f Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Sat, 11 Jan 2014 14:21:29 -0800 Subject: [PATCH 049/117] Test more versions of ruby --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e81c47f0..b755342c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ rvm: - 2.0.0 + - 2.1.0 + - 1.9.3 + - jruby-18mode - jruby-19mode - - rbx-19mode + - rbx From bc06a4824a38ea078ec7ab04975c70a22d91e1d6 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Sat, 11 Jan 2014 14:29:50 -0800 Subject: [PATCH 050/117] Version 0.4.5 not 0.4.4 --- lib/linked_in/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index a63ca769..48fcafc5 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -3,7 +3,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 0 MINOR = 4 - PATCH = 4 + PATCH = 5 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From 87488974f5797333cb4defde41177e74b918975b Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Sat, 11 Jan 2014 14:32:28 -0800 Subject: [PATCH 051/117] Fixing up gemspec warnings --- linkedin.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linkedin.gemspec b/linkedin.gemspec index 86141b91..0da54b38 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -18,8 +18,9 @@ Gem::Specification.new do |gem| gem.files = `git ls-files`.split("\n") gem.homepage = 'http://github.com/hexgnu/linkedin' gem.name = 'linkedin' + gem.licenses = %w[MIT] gem.require_paths = ['lib'] - gem.summary = gem.description + gem.summary = 'This gem interfaces with the Linkedin XML and JSON APis' gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.version = LinkedIn::VERSION::STRING end From cd2459880ce1501c3f1efe70dae25139d52ed5ef Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Mon, 13 Jan 2014 16:14:51 -0600 Subject: [PATCH 052/117] Added tests and functions to do a singular email search. --- lib/linked_in/api/query_methods.rb | 2 + lib/linked_in/mash.rb | 6 +- spec/cases/mash_spec.rb | 9 +- spec/cases/search_spec.rb | 19 ++ .../_search/by_email_address.yml | 195 ++++++++++++++++++ 5 files changed, 226 insertions(+), 5 deletions(-) create mode 100644 spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index f5af1fb6..d809ad9d 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -135,6 +135,8 @@ def person_path(options) path += "id=#{id}" elsif url = options.delete(:url) path += "url=#{CGI.escape(url)}" + elsif email = options.delete(:email) + path += "::(email=#{email})" else path += "~" end diff --git a/lib/linked_in/mash.rb b/lib/linked_in/mash.rb index 8079fff8..eab7edab 100644 --- a/lib/linked_in/mash.rb +++ b/lib/linked_in/mash.rb @@ -39,8 +39,10 @@ def contains_date_fields? # keys are made a little more ruby-ish def convert_key(key) case key.to_s - when '_key' - 'id' + + # Dont' convert the id column on return results from linkedIn. Throwing away valuable data + #when '_key' + # 'id' when '_total' 'total' when 'values' diff --git a/spec/cases/mash_spec.rb b/spec/cases/mash_spec.rb index 982b38cc..c79c748f 100644 --- a/spec/cases/mash_spec.rb +++ b/spec/cases/mash_spec.rb @@ -29,9 +29,11 @@ mash.should have_key('last_name') end - it "should convert the key _key to id" do - mash.should have_key('id') - end + + # this breaks data coming back from linkedIn + #it "should convert the key _key to id" do + # mash.should have_key('id') + #end it "should convert the key _total to total" do mash.should have_key('total') @@ -44,6 +46,7 @@ it "should convert the key numResults to total_results" do mash.should have_key('total_results') end + end describe '#timestamp' do diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index f007c683..3dc82c4a 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -156,6 +156,25 @@ end end + describe "by_email_address" do + use_vcr_cassette :record => :new_episodes + + let(:results) do + fields = ['id'] + client.profile(:email => 'yy@zz.com', :fields => fields) + end + + it "should perform a people search" do + results._total.should == 1 + output = results["values"] + output.each do |record| + puts record._key + record.id.should == '96GVfLeWjU' + record._key.should == 'email=yy@zz.com' + end + end + end + describe "by first_name and last_name options with fields" do use_vcr_cassette :record => :new_episodes diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml new file mode 100644 index 00000000..016bfcd8 --- /dev/null +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml @@ -0,0 +1,195 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com,email=xx@yy.com):(id) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - '*/*' + User-Agent: + - OAuth gem v0.4.7 + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", + oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + response: + status: + code: 200 + message: ok + headers: + Server: + - Apache-Coyote/1.1 + X-Li-Request-Id: + - QG386P3UQ9 + Date: + - Mon, 13 Jan 2014 21:33:51 GMT + Vary: + - '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + X-Li-Fabric: + - PROD-ELA4 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Li-Pop: + - PROD-ELA4 + X-Li-Uuid: + - gNIS8z8GSRNwtDkbISsAAA== + Set-Cookie: + - lidc="b=LB33:g=40:u=1:i=1389648831:t=1389649431:s=2943015068"; Expires=Mon, + 13 Jan 2014 21:43:51 GMT; domain=.linkedin.com; Path=/ + body: + encoding: UTF-8 + string: |- + { + "_total": 10, + "values": [{ + "_key": "email=yy@zz.com", + "id": "96GVfLeWjU" + }, + { + "_key": "email=xx@yy.com", + "id": "10CGfLfLhI" + }] + } + http_version: + recorded_at: Mon, 13 Jan 2014 21:33:51 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com):(educations,positions) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - '*/*' + User-Agent: + - OAuth gem v0.4.7 + Authorization: + - OAuth oauth_consumer_key="key", oauth_nonce="L1nmw8jPLf1HkNpq04y8CW4oJh47GYbXo0PbrfGIDM", + oauth_signature="DUuo7p10ljV%2Bui4GwZoK2pP7auI%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1389649097", oauth_token="key", oauth_version="1.0" + response: + status: + code: 200 + message: ok + headers: + Server: + - Apache-Coyote/1.1 + X-Li-Request-Id: + - Q7YQXSEUAV + Date: + - Mon, 13 Jan 2014 21:38:17 GMT + Vary: + - '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + X-Li-Fabric: + - PROD-ELA4 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Li-Pop: + - PROD-ELA4 + X-Li-Uuid: + - gJ6LBn4GSRNQWXJR/CoAAA== + Set-Cookie: + - lidc="b=LB04:g=16:u=1:i=1389649098:t=1389649698:s=1430218146"; Expires=Mon, + 13 Jan 2014 21:48:18 GMT; domain=.linkedin.com; Path=/ + body: + encoding: UTF-8 + string: |- + { + "_total": 2, + "values": [{ + "_key": "email=yy@zz.com", + "id": "96GVfLeWjU" + }, + { + "_key": "email=xx@yy.com", + "id": "10CGfLfLhI" + }] + } + http_version: + recorded_at: Mon, 13 Jan 2014 21:38:18 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com):(id) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - '*/*' + User-Agent: + - OAuth gem v0.4.7 + Authorization: + - OAuth oauth_consumer_key="key", oauth_nonce="KkLqrO8OnlnRKJFUnwnHvyDpmT5lzyVuPPU38MHKXE", + oauth_signature="kR6yrOhUD3SUay3k2bP2YdxwB6U%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1389649903", oauth_token="key", oauth_version="1.0" + response: + status: + code: 200 + message: ok + headers: + Server: + - Apache-Coyote/1.1 + X-Li-Request-Id: + - 4506AHDFV4 + Date: + - Mon, 13 Jan 2014 21:51:43 GMT + Vary: + - '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + X-Li-Fabric: + - PROD-ELA4 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Li-Pop: + - PROD-ELA4 + X-Li-Uuid: + - SCj2pjkHSRPw0yJYdCsAAA== + Set-Cookie: + - lidc="b=LB34:g=45:u=1:i=1389649904:t=1389650504:s=2677822921"; Expires=Mon, + 13 Jan 2014 22:01:44 GMT; domain=.linkedin.com; Path=/ + body: + encoding: UTF-8 + string: |- + { + "_total": 1, + "values": [{ + "_key": "email=yy@zz.com", + "id": "96GVfLeWjU" + }] + } + http_version: + recorded_at: Mon, 13 Jan 2014 21:51:44 GMT +recorded_with: VCR 2.8.0 From 70714058a6eeadb228cf2634c76441b87d29e879 Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Mon, 13 Jan 2014 16:28:54 -0600 Subject: [PATCH 053/117] Added multi-email support and testing. --- lib/linked_in/api/query_methods.rb | 2 +- spec/cases/search_spec.rb | 19 ++- .../_search/by_email_address.yml | 131 ------------------ .../_search/by_multiple_email_address.yml | 68 +++++++++ 4 files changed, 86 insertions(+), 134 deletions(-) create mode 100644 spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index d809ad9d..ee55a264 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -136,7 +136,7 @@ def person_path(options) elsif url = options.delete(:url) path += "url=#{CGI.escape(url)}" elsif email = options.delete(:email) - path += "::(email=#{email})" + path += "::(#{email})" else path += "~" end diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 3dc82c4a..14b4e9cf 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -161,20 +161,35 @@ let(:results) do fields = ['id'] - client.profile(:email => 'yy@zz.com', :fields => fields) + client.profile(:email => 'email=yy@zz.com', :fields => fields) end it "should perform a people search" do results._total.should == 1 output = results["values"] output.each do |record| - puts record._key record.id.should == '96GVfLeWjU' record._key.should == 'email=yy@zz.com' end end + end + describe "by_multiple_email_address" do + use_vcr_cassette :record => :new_episodes + let(:results) do + fields = ['id'] + client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => fields) + end + + it "should perform a multi-email search" do + results._total.should == 2 + output = results["values"] + output.count.should == 2 + end + end + + describe "by first_name and last_name options with fields" do use_vcr_cassette :record => :new_episodes diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml index 016bfcd8..e288cfa9 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml @@ -1,136 +1,5 @@ --- http_interactions: -- request: - method: get - uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com,email=xx@yy.com):(id) - body: - encoding: US-ASCII - string: '' - headers: - X-Li-Format: - - json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - '*/*' - User-Agent: - - OAuth gem v0.4.7 - Authorization: - - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", - oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", - oauth_version="1.0" - response: - status: - code: 200 - message: ok - headers: - Server: - - Apache-Coyote/1.1 - X-Li-Request-Id: - - QG386P3UQ9 - Date: - - Mon, 13 Jan 2014 21:33:51 GMT - Vary: - - '*' - X-Li-Format: - - json - Content-Type: - - application/json;charset=UTF-8 - X-Li-Fabric: - - PROD-ELA4 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Li-Pop: - - PROD-ELA4 - X-Li-Uuid: - - gNIS8z8GSRNwtDkbISsAAA== - Set-Cookie: - - lidc="b=LB33:g=40:u=1:i=1389648831:t=1389649431:s=2943015068"; Expires=Mon, - 13 Jan 2014 21:43:51 GMT; domain=.linkedin.com; Path=/ - body: - encoding: UTF-8 - string: |- - { - "_total": 10, - "values": [{ - "_key": "email=yy@zz.com", - "id": "96GVfLeWjU" - }, - { - "_key": "email=xx@yy.com", - "id": "10CGfLfLhI" - }] - } - http_version: - recorded_at: Mon, 13 Jan 2014 21:33:51 GMT -- request: - method: get - uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com):(educations,positions) - body: - encoding: US-ASCII - string: '' - headers: - X-Li-Format: - - json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - '*/*' - User-Agent: - - OAuth gem v0.4.7 - Authorization: - - OAuth oauth_consumer_key="key", oauth_nonce="L1nmw8jPLf1HkNpq04y8CW4oJh47GYbXo0PbrfGIDM", - oauth_signature="DUuo7p10ljV%2Bui4GwZoK2pP7auI%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1389649097", oauth_token="key", oauth_version="1.0" - response: - status: - code: 200 - message: ok - headers: - Server: - - Apache-Coyote/1.1 - X-Li-Request-Id: - - Q7YQXSEUAV - Date: - - Mon, 13 Jan 2014 21:38:17 GMT - Vary: - - '*' - X-Li-Format: - - json - Content-Type: - - application/json;charset=UTF-8 - X-Li-Fabric: - - PROD-ELA4 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - X-Li-Pop: - - PROD-ELA4 - X-Li-Uuid: - - gJ6LBn4GSRNQWXJR/CoAAA== - Set-Cookie: - - lidc="b=LB04:g=16:u=1:i=1389649098:t=1389649698:s=1430218146"; Expires=Mon, - 13 Jan 2014 21:48:18 GMT; domain=.linkedin.com; Path=/ - body: - encoding: UTF-8 - string: |- - { - "_total": 2, - "values": [{ - "_key": "email=yy@zz.com", - "id": "96GVfLeWjU" - }, - { - "_key": "email=xx@yy.com", - "id": "10CGfLfLhI" - }] - } - http_version: - recorded_at: Mon, 13 Jan 2014 21:38:18 GMT - request: method: get uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com):(id) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml new file mode 100644 index 00000000..2185c0b0 --- /dev/null +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml @@ -0,0 +1,68 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com,email=xx@yy.com):(id) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - '*/*' + User-Agent: + - OAuth gem v0.4.7 + Authorization: + - OAuth oauth_consumer_key="mpibxdpwbwry", oauth_nonce="eq8g0jFLe2FsDxO255PW6UqoZ8lwJAqiIJCm3qEKF8", + oauth_signature="D1xMNnx7aOxDotnPt1mtEdbJPlU%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1365631656", oauth_token="d9f69cd6-f3f3-4c26-9f2c-12cd8e228089", + oauth_version="1.0" + response: + status: + code: 200 + message: ok + headers: + Server: + - Apache-Coyote/1.1 + X-Li-Request-Id: + - QG386P3UQ9 + Date: + - Mon, 13 Jan 2014 21:33:51 GMT + Vary: + - '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + X-Li-Fabric: + - PROD-ELA4 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Li-Pop: + - PROD-ELA4 + X-Li-Uuid: + - gNIS8z8GSRNwtDkbISsAAA== + Set-Cookie: + - lidc="b=LB33:g=40:u=1:i=1389648831:t=1389649431:s=2943015068"; Expires=Mon, + 13 Jan 2014 21:43:51 GMT; domain=.linkedin.com; Path=/ + body: + encoding: UTF-8 + string: |- + { + "_total": 2, + "values": [{ + "_key": "email=yy@zz.com", + "id": "96GVfLeWjU" + }, + { + "_key": "email=xx@yy.com", + "id": "10CGfLfLhI" + }] + } + http_version: + recorded_at: Mon, 13 Jan 2014 21:33:51 GMT \ No newline at end of file From bd99f039abd7f1f8ee1c0d59dfc5e6cd1b7f96ab Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Mon, 13 Jan 2014 16:45:55 -0600 Subject: [PATCH 054/117] Added an example invocation. --- examples/profile.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/profile.rb b/examples/profile.rb index 2eb76950..14ce65b1 100644 --- a/examples/profile.rb +++ b/examples/profile.rb @@ -16,3 +16,6 @@ companies = user.positions.all.map{|t| t.company} # Example: most recent company can be accessed via companies[0] +# Example of a multi-email search against the special email search API +account_exists = client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => ['id']) + From d9e945e10f8b1bc5ed9790ebf2fda2556c022c3e Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Tue, 14 Jan 2014 10:31:25 -0600 Subject: [PATCH 055/117] Added unauthorized test and cassette. --- spec/cases/mash_spec.rb | 1 - spec/cases/search_spec.rb | 8 +++ .../email_search_returns_unauthorized.yml | 64 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml diff --git a/spec/cases/mash_spec.rb b/spec/cases/mash_spec.rb index c79c748f..ffed3157 100644 --- a/spec/cases/mash_spec.rb +++ b/spec/cases/mash_spec.rb @@ -46,7 +46,6 @@ it "should convert the key numResults to total_results" do mash.should have_key('total_results') end - end describe '#timestamp' do diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 14b4e9cf..97d11ac3 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -189,6 +189,14 @@ end end + describe "email_search_returns_unauthorized" do + use_vcr_cassette :record => :new_episodes + let(:results) do + fields = ['id'] + expect {client.profile(:email => 'email=aa@bb.com', :fields => fields)}.to raise_error() + end + end + describe "by first_name and last_name options with fields" do use_vcr_cassette :record => :new_episodes diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml new file mode 100644 index 00000000..e6e173d2 --- /dev/null +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml @@ -0,0 +1,64 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/people/::(email=aa@bb.com):(id) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - '*/*' + User-Agent: + - OAuth gem v0.4.7 + Authorization: + - OAuth oauth_consumer_key="key", oauth_nonce="Ny9c0n0y0Eg7cnVjVbUlDPeQap8qjzhdPNY3sAi5K8", + oauth_signature="vd%2Fd5TC906HXqp50%2BRUT3ZeHC2E%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1389716461", oauth_token="key", oauth_version="1.0" + response: + status: + code: 401 + message: Unauthorized + headers: + Server: + - Apache-Coyote/1.1 + X-Li-Request-Id: + - X1OTF3POH3 + Date: + - Tue, 14 Jan 2014 16:20:58 GMT + Vary: + - '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + X-Li-Fabric: + - PROD-ELA4 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Li-Pop: + - PROD-ELA4 + X-Li-Uuid: + - iD/VocFDSROQ7fHxASsAAA== + Set-Cookie: + - lidc="b=LB37:g=42:u=1:i=1389716458:t=1389717058:s=1572779068"; Expires=Tue, + 14 Jan 2014 16:30:58 GMT; domain=.linkedin.com; Path=/ + body: + encoding: UTF-8 + string: |- + { + "errorCode": 0, + "message": "[unauthorized]. No consumer found for key key", + "requestId": "X1OTF3POH3", + "status": 401, + "timestamp": 1389716458976 + } + http_version: + recorded_at: Tue, 14 Jan 2014 16:21:01 GMT +recorded_with: VCR 2.8.0 From 72d282b30a8bad11959b5253d795687103050e6c Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Tue, 14 Jan 2014 10:38:16 -0600 Subject: [PATCH 056/117] Cleaning up trailing spaces. --- spec/cases/search_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 97d11ac3..4f0a8f3b 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -172,7 +172,6 @@ record._key.should == 'email=yy@zz.com' end end - end describe "by_multiple_email_address" do From 3af72c9a2a62e92ee4830e7148b36c2be6f16ff5 Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Tue, 14 Jan 2014 10:52:10 -0600 Subject: [PATCH 057/117] Fixed unauthorized response test. --- spec/cases/search_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 4f0a8f3b..4a6df42c 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -190,13 +190,13 @@ describe "email_search_returns_unauthorized" do use_vcr_cassette :record => :new_episodes - let(:results) do + + it "should raise an unauthorized error" do fields = ['id'] - expect {client.profile(:email => 'email=aa@bb.com', :fields => fields)}.to raise_error() + expect {client.profile(:email => 'email=aa@bb.com', :fields => fields)}.to raise_error(LinkedIn::Errors::UnauthorizedError) end end - describe "by first_name and last_name options with fields" do use_vcr_cassette :record => :new_episodes From e4d75781579e7a944ea70a414371e08325ab93eb Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Tue, 14 Jan 2014 12:59:02 -0600 Subject: [PATCH 058/117] Removed underscores from test describes. --- spec/cases/search_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 4a6df42c..9c5a5c6c 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -156,7 +156,7 @@ end end - describe "by_email_address" do + describe "by email address" do use_vcr_cassette :record => :new_episodes let(:results) do @@ -174,7 +174,7 @@ end end - describe "by_multiple_email_address" do + describe "by multiple email address" do use_vcr_cassette :record => :new_episodes let(:results) do fields = ['id'] @@ -188,7 +188,7 @@ end end - describe "email_search_returns_unauthorized" do + describe "email search returns unauthorized" do use_vcr_cassette :record => :new_episodes it "should raise an unauthorized error" do From b8ba113daec72a41e86488e37f9abfa11a5e7d15 Mon Sep 17 00:00:00 2001 From: Brent Kastner Date: Tue, 14 Jan 2014 13:20:49 -0600 Subject: [PATCH 059/117] Addressed response body from an unauthorized request. Addressed url path for calls to email. --- lib/linked_in/api/query_methods.rb | 8 ++++---- spec/cases/search_spec.rb | 1 + .../LinkedIn_Search/_search/by_email_address.yml | 5 ++--- .../_search/by_multiple_email_address.yml | 4 ++-- .../_search/email_search_returns_unauthorized.yml | 13 ++++++------- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index ee55a264..e63516c0 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -130,15 +130,15 @@ def build_fields_params(fields) end def person_path(options) - path = "/people/" + path = "/people" if id = options.delete(:id) - path += "id=#{id}" + path += "/id=#{id}" elsif url = options.delete(:url) - path += "url=#{CGI.escape(url)}" + path += "/url=#{CGI.escape(url)}" elsif email = options.delete(:email) path += "::(#{email})" else - path += "~" + path += "/~" end end diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 9c5a5c6c..652274c0 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -176,6 +176,7 @@ describe "by multiple email address" do use_vcr_cassette :record => :new_episodes + let(:results) do fields = ['id'] client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => fields) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml index e288cfa9..4a481a48 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com):(id) + uri: https://api.linkedin.com/v1/people::(email=yy@zz.com):(id) body: encoding: US-ASCII string: '' @@ -60,5 +60,4 @@ http_interactions: }] } http_version: - recorded_at: Mon, 13 Jan 2014 21:51:44 GMT -recorded_with: VCR 2.8.0 + recorded_at: Mon, 13 Jan 2014 21:51:44 GMT \ No newline at end of file diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml index 2185c0b0..36350f11 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.linkedin.com/v1/people/::(email=yy@zz.com,email=xx@yy.com):(id) + uri: https://api.linkedin.com/v1/people::(email=yy@zz.com,email=xx@yy.com):(id) body: encoding: US-ASCII string: '' @@ -64,5 +64,5 @@ http_interactions: "id": "10CGfLfLhI" }] } - http_version: + http_version: recorded_at: Mon, 13 Jan 2014 21:33:51 GMT \ No newline at end of file diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml index e6e173d2..da83ecd6 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.linkedin.com/v1/people/::(email=aa@bb.com):(id) + uri: https://api.linkedin.com/v1/people::(email=aa@bb.com):(id) body: encoding: US-ASCII string: '' @@ -54,11 +54,10 @@ http_interactions: string: |- { "errorCode": 0, - "message": "[unauthorized]. No consumer found for key key", - "requestId": "X1OTF3POH3", - "status": 401, - "timestamp": 1389716458976 + "message": "Access to member by email address denied", + "requestId": "BRSUSQTPPW", + "status": 403, + "timestamp": 1389727130475 } http_version: - recorded_at: Tue, 14 Jan 2014 16:21:01 GMT -recorded_with: VCR 2.8.0 + recorded_at: Tue, 14 Jan 2014 16:21:01 GMT \ No newline at end of file From 7c90cad12c241885b94e532c22b529fcefce40e5 Mon Sep 17 00:00:00 2001 From: Kushan Patel Date: Tue, 14 Jan 2014 19:41:52 -0800 Subject: [PATCH 060/117] add a method to get group suggestions for a profile GET http://api.linkedin.com/v1/people/~/suggestions/groups:(id,name,is-open- to-non-members) --- lib/linked_in/api/query_methods.rb | 5 +++++ spec/cases/api_spec.rb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index f5af1fb6..1dce922f 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -58,6 +58,11 @@ def job_suggestions(options = {}) simple_query(path, options) end + def group_suggestions(options = {}) + path = "#{person_path(options)}/suggestions/groups" + simple_query(path, options) + end + def group_memberships(options = {}) path = "#{person_path(options)}/group-memberships" simple_query(path, options) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 9bae0448..a3d531a5 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -227,6 +227,12 @@ client.group_memberships.should be_an_instance_of(LinkedIn::Mash) end + it "should be able to list suggested groups for a profile" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/suggestions/groups").to_return(:body => '{"id": "123"}') + response = client.group_suggestions + response.id.should == '123' + end + it "should be able to parse nested fields" do stub_request(:get, "https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,small-logo-url,short-description))").to_return(:body => "{}") client.group_memberships(fields: [{group: ['id', 'name', 'small-logo-url', 'short-description']}]).should be_an_instance_of(LinkedIn::Mash) From bdef2a6785febe676849e20828a2f844c7a8e32b Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Wed, 15 Jan 2014 06:37:04 -0800 Subject: [PATCH 061/117] Allowing _key to be converted if there is no collisions --- lib/linked_in/mash.rb | 12 ++++++++---- spec/cases/mash_spec.rb | 22 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/linked_in/mash.rb b/lib/linked_in/mash.rb index eab7edab..f8642006 100644 --- a/lib/linked_in/mash.rb +++ b/lib/linked_in/mash.rb @@ -19,6 +19,14 @@ def to_date end end + def id + if self['id'] + self['id'] + else + self['_key'] + end + end + def timestamp value = self['timestamp'] if value.kind_of? Integer @@ -39,10 +47,6 @@ def contains_date_fields? # keys are made a little more ruby-ish def convert_key(key) case key.to_s - - # Dont' convert the id column on return results from linkedIn. Throwing away valuable data - #when '_key' - # 'id' when '_total' 'total' when 'values' diff --git a/spec/cases/mash_spec.rb b/spec/cases/mash_spec.rb index ffed3157..d5da0e88 100644 --- a/spec/cases/mash_spec.rb +++ b/spec/cases/mash_spec.rb @@ -18,6 +18,7 @@ 'firstName' => 'Josh', 'LastName' => 'Kalderimis', '_key' => 1234, + 'id' => 1345, '_total' => 1234, 'values' => {}, 'numResults' => 'total_results' @@ -29,11 +30,24 @@ mash.should have_key('last_name') end - # this breaks data coming back from linkedIn - #it "should convert the key _key to id" do - # mash.should have_key('id') - #end + it "converts _key to id if there is an id column" do + mash._key.should == 1234 + mash.id.should == 1345 + end + + context 'no collision' do + let(:mash) { + LinkedIn::Mash.new({ + '_key' => 1234 + }) + + } + it 'converts _key to id if there is no collision' do + mash.id.should == 1234 + mash._key.should == 1234 + end + end it "should convert the key _total to total" do mash.should have_key('total') From f269600b082050e86d867e49c2206dc22c54e5eb Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Wed, 15 Jan 2014 10:50:02 -0500 Subject: [PATCH 062/117] LinkedIn::Mash#all returns [] instead of nil when there are no results --- lib/linked_in/mash.rb | 4 ++++ spec/cases/mash_spec.rb | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/linked_in/mash.rb b/lib/linked_in/mash.rb index f8642006..4b7d170d 100644 --- a/lib/linked_in/mash.rb +++ b/lib/linked_in/mash.rb @@ -37,6 +37,10 @@ def timestamp end end + def all + super || [] + end + protected def contains_date_fields? diff --git a/spec/cases/mash_spec.rb b/spec/cases/mash_spec.rb index d5da0e88..08021e39 100644 --- a/spec/cases/mash_spec.rb +++ b/spec/cases/mash_spec.rb @@ -98,4 +98,16 @@ end end + describe "#all" do + let(:all_mash) do + LinkedIn::Mash.new({ + :values => nil + }) + end + + it "should return an empty array if values is nil due to no results being found for a query" do + all_mash.all.should == [] + end + end + end From 9401aeb5c7cff34a2f48155968dbf0a76af2a161 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 16 Jan 2014 09:36:28 -0800 Subject: [PATCH 063/117] Warning about post_group_discussion --- lib/linked_in/api/update_methods.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index d0f5189c..83bd7089 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -15,6 +15,11 @@ def add_company_share(company_id, share) post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + def post_group_discussion(group_id, discussion) + warn 'Use add_group_share over post_group_discussion. This will be taken out in future versions' + add_group_share(group_id, discussion) + end + def add_group_share(group_id, share) path = "/groups/#{group_id}/posts" post(path, share.to_json, "Content-Type" => "application/json") @@ -74,11 +79,6 @@ def send_message(subject, body, recipient_paths) post(path, message.to_json, "Content-Type" => "application/json") end - def post_group_discussion(group_id, discussion) - path = "/groups/#{group_id}/posts" - post(path, discussion.to_json, "Content-Type" => "application/json") - end - end end From a2b1f85701b60559213c84c224f9631d3d27c6c9 Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Wed, 15 Jan 2014 22:45:29 -0500 Subject: [PATCH 064/117] Switch to yard instead of rdoc --- .document | 5 ----- .yardopts | 6 ++++++ Rakefile | 9 ++------- lib/linkedin.rb | 5 ++++- linkedin.gemspec | 3 ++- 5 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 .document create mode 100644 .yardopts diff --git a/.document b/.document deleted file mode 100644 index ecf36731..00000000 --- a/.document +++ /dev/null @@ -1,5 +0,0 @@ -README.rdoc -lib/**/*.rb -bin/* -features/**/*.feature -LICENSE diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..5199c275 --- /dev/null +++ b/.yardopts @@ -0,0 +1,6 @@ +--no-private +--markup markdown +- +README.md +CHANGELOG.md +LICENSE diff --git a/Rakefile b/Rakefile index ab591f4c..f8197d6b 100755 --- a/Rakefile +++ b/Rakefile @@ -10,11 +10,6 @@ task :test => :spec task :default => :spec load 'vcr/tasks/vcr.rake' -require 'rdoc/task' require File.expand_path('../lib/linked_in/version', __FILE__) -RDoc::Task.new do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "linkedin #{LinkedIn::VERSION::STRING}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end +require 'yard' +YARD::Rake::YardocTask.new diff --git a/lib/linkedin.rb b/lib/linkedin.rb index cd3524bf..513f55ca 100644 --- a/lib/linkedin.rb +++ b/lib/linkedin.rb @@ -7,15 +7,18 @@ class << self # config/initializers/linkedin.rb (for instance) # + # ```ruby # LinkedIn.configure do |config| # config.token = 'consumer_token' # config.secret = 'consumer_secret' # config.default_profile_fields = ['educations', 'positions'] # end - # + # ``` # elsewhere # + # ```ruby # client = LinkedIn::Client.new + # ``` def configure yield self true diff --git a/linkedin.gemspec b/linkedin.gemspec index 0da54b38..394ab635 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -7,7 +7,8 @@ Gem::Specification.new do |gem| gem.add_dependency 'oauth', '~> 0.4' # gem.add_development_dependency 'json', '~> 1.6' gem.add_development_dependency 'rake', '~> 10' - gem.add_development_dependency 'rdoc', '~> 4.0' + gem.add_development_dependency 'yard' + gem.add_development_dependency 'redcarpet', '~> 2.0' gem.add_development_dependency 'rspec', '~> 2.13' gem.add_development_dependency 'simplecov', '~> 0.7' gem.add_development_dependency 'vcr', '~> 2.5' From eec4b4e09993e05499a4aff384573b389d2dcb3c Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Fri, 17 Jan 2014 21:48:38 -0500 Subject: [PATCH 065/117] Consistent, simple file naming --- changelog.markdown => CHANGELOG.md | 0 README.markdown => README.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename changelog.markdown => CHANGELOG.md (100%) rename README.markdown => README.md (100%) diff --git a/changelog.markdown b/CHANGELOG.md similarity index 100% rename from changelog.markdown rename to CHANGELOG.md diff --git a/README.markdown b/README.md similarity index 100% rename from README.markdown rename to README.md From 4e3b2cae55e5b6c1109dbb6b1819f70602f9ccfd Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Fri, 17 Jan 2014 21:50:26 -0500 Subject: [PATCH 066/117] Updates to README * Add link to CHANGELOG in README * Update examples link. Relates to #204 * JSON API is now being used, so remove TODO * Add section in README about documentation --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 00ba17d0..878b0a9a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)]( gem install linkedin +## Documentation + +Documented with yard. To view documentation locally, run: `yard server` + ## Usage ### Authenticate @@ -60,9 +64,17 @@ For a nice example on using this in a [Rails App](http://pivotallabs.com/users/w If you want to play with the LinkedIn api without using the gem, have a look at the [apigee LinkedIn console](http://app.apigee.com/console/linkedin). +## Examples + +More examples are in the [examples folder](http://github.com/hexgnu/linkedin/blob/master/examples). + + +## Changelog + +[View the Changelog](CHANGELOG.md) + ## TODO -* Change to json api * Update and correct test suite * Change to Faraday for authentication * Implement Messaging APIs From 833ccad0ed557ad028a213f4b3fb54ba035755bc Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Fri, 17 Jan 2014 22:25:30 -0500 Subject: [PATCH 067/117] Document all query and update methods --- lib/linked_in/api.rb | 26 +++++ lib/linked_in/api/query_methods.rb | 156 ++++++++++++++++++++++++++++ lib/linked_in/api/update_methods.rb | 96 +++++++++++++++++ 3 files changed, 278 insertions(+) diff --git a/lib/linked_in/api.rb b/lib/linked_in/api.rb index cb1b0dcd..12d8e369 100644 --- a/lib/linked_in/api.rb +++ b/lib/linked_in/api.rb @@ -1,5 +1,31 @@ module LinkedIn module Api + + # @!macro person_path_options + # @param [Hash] options identifies the user profile you want + # @option options [String] :id a member token + # @option options [String] :url a Public Profile URL + # @option options [String] :email TODO + + # @!macro company_path_options + # @param [Hash] options identifies the user profile you want + # @option options [String] :domain company email domain + # @option options [String] :id company ID + # @option options [String] :url TODO + # @option options [String] :name company universal name + # @option options [String] :is_admin TODO + + # @!macro share_input_fields + # @param [Hash] share content of the share + # @option share [String] :comment + # @option share [String] :content + # @option share [String] :title + # @option share [String] :submitted_url TODO + # @option share [String] :submitted_image_url TODO + # @option share [String] :description + # @option share [String] :visibility + # @option share [String] :code + autoload :QueryMethods, "linked_in/api/query_methods" autoload :UpdateMethods, "linked_in/api/update_methods" end diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb index 88a61283..610f8b31 100644 --- a/lib/linked_in/api/query_methods.rb +++ b/lib/linked_in/api/query_methods.rb @@ -3,96 +3,252 @@ module Api module QueryMethods + # Retrieve a member's LinkedIn profile. + # + # Permissions: r_basicprofile, r_fullprofile + # + # @see http://developer.linkedin.com/documents/profile-api + # @macro person_path_options + # @return [LinkedIn::Mash] def profile(options={}) path = person_path(options) simple_query(path, options) end + # Retrieve a list of 1st degree connections for a user who has + # granted access to his/her account + # + # Permissions: r_network + # + # @see http://developer.linkedin.com/documents/connections-api + # + # @macro person_path_options + # @return [LinkedIn::Mash] def connections(options={}) path = "#{person_path(options)}/connections" simple_query(path, options) end + # Retrieve the authenticated users network updates + # + # TODO Permissions? + # + # @see http://developer.linkedin.com/documents/get-network-updates-and-statistics-api + # + # @macro person_path_options + # @option options [String] :scope + # @option options [String] :type + # @option options [String] :count + # @option options [String] :start + # @option options [String] :after + # @option options [String] :before + # @option options [String] :show-hidden-members + # @return [LinkedIn::Mash] def network_updates(options={}) path = "#{person_path(options)}/network/updates" simple_query(path, options) end + # Retrieve a Company Profile + # + # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields + # + # @macro company_path_options + # @option options [String] :scope + # @option options [String] :type + # @option options [String] :count + # @option options [String] :start + # @return [LinkedIn::Mash] def company(options = {}) path = company_path(options) simple_query(path, options) end + # Retrieve a feed of event items for a Company + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @macro company_path_options + # @option options [String] :event_type + # @option options [String] :count + # @option options [String] :start + # @return [LinkedIn::Mash] def company_updates(options={}) path = "#{company_path(options)}/updates" simple_query(path, options) end + # Retrieve statistics for a particular company page + # + # Permissions: rw_company_admin + # + # @see http://developer.linkedin.com/documents/company-statistics + # + # @macro company_path_options + # @return [LinkedIn::Mash] def company_statistics(options={}) path = "#{company_path(options)}/company-statistics" simple_query(path, options) end + # Retrieve comments on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [String] update_key a update/update-key representing a + # particular company update + # @macro company_path_options + # @return [LinkedIn::Mash] def company_updates_comments(update_key, options={}) path = "#{company_path(options)}/updates/key=#{update_key}/update-comments" simple_query(path, options) end + # Retrieve likes on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [String] update_key a update/update-key representing a + # particular company update + # @macro company_path_options + # @return [LinkedIn::Mash] def company_updates_likes(update_key, options={}) path = "#{company_path(options)}/updates/key=#{update_key}/likes" simple_query(path, options) end + # Retrieve likes on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [Hash] options identifies the job + # @option options [String] id unique identifier for a job + # @return [LinkedIn::Mash] def job(options = {}) path = jobs_path(options) simple_query(path, options) end + # Retrieve the current members' job bookmarks + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] def job_bookmarks(options = {}) path = "#{person_path(options)}/job-bookmarks" simple_query(path, options) end + # Retrieve job suggestions for the current user + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] def job_suggestions(options = {}) path = "#{person_path(options)}/suggestions/job-suggestions" simple_query(path, options) end + # Retrieve job suggestions for the current user + # + # Permissions: r_fullprofile + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] def group_suggestions(options = {}) path = "#{person_path(options)}/suggestions/groups" simple_query(path, options) end + # Retrieve the groups a current user belongs to + # + # Permissions: rw_groups + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @macro person_path_options + # @return [LinkedIn::Mash] def group_memberships(options = {}) path = "#{person_path(options)}/group-memberships" simple_query(path, options) end + # Retrieve the profile of a group + # + # Permissions: rw_groups TODO + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @param [Hash] options identifies the group or groups + # @optio options [String] :id identifier for the group + # @return [LinkedIn::Mash] def group_profile(options) path = group_path(options) simple_query(path, options) end + # Retrieve the posts in a group + # + # Permissions: rw_groups TODO + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @param [Hash] options identifies the group or groups + # @optio options [String] :id identifier for the group + # @optio options [String] :count + # @optio options [String] :start + # @return [LinkedIn::Mash] def group_posts(options) path = "#{group_path(options)}/posts" simple_query(path, options) end + # TODO refactor to use #network_updates def shares(options={}) path = "#{person_path(options)}/network/updates" simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) end + # Retrieve all comments for a particular network update + # + # @note The first 5 comments are included in the response to #network_updates + # + # TODO Permissions? rw_nus? + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] update_key a update/update-key representing a + # particular network update + # @macro person_path_options + # @return [LinkedIn::Mash] def share_comments(update_key, options={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments" simple_query(path, options) end + # Retrieve all likes for a particular network update + # + # @note Some likes are included in the response to #network_updates + # + # TODO Permissions? rw_nus? + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] update_key a update/update-key representing a + # particular network update + # @macro person_path_options + # @return [LinkedIn::Mash] def share_likes(update_key, options={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" simple_query(path, options) end + # TODO can't find this method in the REST API documentation and it + # doesn't seem to work when I tried it out from the command line def picture_urls(options={}) picture_size = options.delete(:picture_size) || 'original' path = "#{picture_urls_path(options)}::(#{picture_size})" diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb index 83bd7089..60639213 100644 --- a/lib/linked_in/api/update_methods.rb +++ b/lib/linked_in/api/update_methods.rb @@ -3,67 +3,163 @@ module Api module UpdateMethods + # Create a share for the authenticated user + # + # Permissions: rw_nus + # + # @see http://developer.linkedin.com/documents/share-api + # + # @macro share_input_fields + # @return [void] def add_share(share) path = "/people/~/shares" defaults = {:visibility => {:code => "anyone"}} post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + # Create a share for a company that the authenticated user + # administers + # + # Permissions: rw_company_admin + # + # @see http://developer.linkedin.com/creating-company-shares + # + # @param [String] company_id Company ID + # @macro share_input_fields + # @return [void] def add_company_share(company_id, share) path = "/companies/#{company_id}/shares" defaults = {:visibility => {:code => "anyone"}} post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") end + # @deprecated Use {#add_group_share} instead def post_group_discussion(group_id, discussion) warn 'Use add_group_share over post_group_discussion. This will be taken out in future versions' add_group_share(group_id, discussion) end + # Create a share for a company that the authenticated user + # administers + # + # Permissions: rw_groups + # + # @see http://developer.linkedin.com/documents/groups-api#create + # + # @param [String] group_id Group ID + # @macro share_input_fields + # @return [void] def add_group_share(group_id, share) path = "/groups/#{group_id}/posts" post(path, share.to_json, "Content-Type" => "application/json") end + # (Create) authenticated user starts following a company + # + # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # + # @param [String] company_id Company ID + # @return [void] def follow_company(company_id) path = "/people/~/following/companies" body = {:id => company_id } post(path, body.to_json, "Content-Type" => "application/json") end + # (Destroy) authenticated user stops following a company + # + # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # + # @param [String] company_id Company ID + # @return [void] def unfollow_company(company_id) path = "/people/~/following/companies/id=#{company_id}" delete(path) end + # (Update) User joins, or requests to join, a group + # + # @see http://developer.linkedin.com/documents/groups-api#membergroups + # + # @param [String] group_id Group ID + # @return [void] def join_group(group_id) path = "/people/~/group-memberships/#{group_id}" body = {'membership-state' => {'code' => 'member' }} put(path, body.to_json, "Content-Type" => "application/json") end + # Create a job bookmark for the authenticated user + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @param [String] bookmark Job ID + # @return [void] def add_job_bookmark(bookmark) path = "/people/~/job-bookmarks" body = {'job' => {'id' => bookmark}} post(path, body.to_json, "Content-Type" => "application/json") end + # Create a comment on an update from the authenticated user + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @param [String] comment The text of the comment + # @return [void] def update_comment(network_key, comment) path = "/people/~/network/updates/key=#{network_key}/update-comments" body = {'comment' => comment} post(path, body.to_json, "Content-Type" => "application/json") end + # (Update) like an update as the authenticated user + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @return [void] def like_share(network_key) path = "/people/~/network/updates/key=#{network_key}/is-liked" put(path, 'true', "Content-Type" => "application/json") end + # (Destroy) unlike an update the authenticated user previously + # liked + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @return [void] def unlike_share(network_key) path = "/people/~/network/updates/key=#{network_key}/is-liked" put(path, 'false', "Content-Type" => "application/json") end + # (Create) send a message from the authenticated user to a + # connection + # + # Permissions: w_messages + # + # @see http://developer.linkedin.com/documents/messaging-between-connections-api + # + # @example + # client.send_message( + # 'What's New?', + # 'Hi, what is going on with you two?', + # ['id=1234', 'id=5678'] + # ) + # + # @param [String] subject Subject of the message + # @param [String] body Body of the message, plain text only + # @param [Array] recipient_paths a collection of + # profile paths that identify the users who will receive the + # message + # @return [void] def send_message(subject, body, recipient_paths) path = "/people/~/mailbox" From 24fe6ece839fda1b83044a3c5bb673b274457cb3 Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 10:30:01 -0500 Subject: [PATCH 068/117] Document Exceptions, Search, and Mash --- lib/linked_in/errors.rb | 14 ++++++++++++-- lib/linked_in/mash.rb | 21 +++++++++++++++++++-- lib/linked_in/search.rb | 17 ++++++++++++++++- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/lib/linked_in/errors.rb b/lib/linked_in/errors.rb index d7a173b4..bded0658 100644 --- a/lib/linked_in/errors.rb +++ b/lib/linked_in/errors.rb @@ -8,12 +8,22 @@ def initialize(data) end end + # Raised when a 401 response status code is received class UnauthorizedError < LinkedInError; end + + # Raised when a 400 response status code is received class GeneralError < LinkedInError; end + + # Raised when a 403 response status code is received class AccessDeniedError < LinkedInError; end - class UnavailableError < StandardError; end - class InformLinkedInError < StandardError; end + # Raised when a 404 response status code is received class NotFoundError < StandardError; end + + # Raised when a 500 response status code is received + class InformLinkedInError < StandardError; end + + # Raised when a 502 or 503 response status code is received + class UnavailableError < StandardError; end end end diff --git a/lib/linked_in/mash.rb b/lib/linked_in/mash.rb index 4b7d170d..b07e8ddd 100644 --- a/lib/linked_in/mash.rb +++ b/lib/linked_in/mash.rb @@ -2,15 +2,23 @@ require 'multi_json' module LinkedIn + + # The generalized pseudo-object that is returned for all query + # requests. class Mash < ::Hashie::Mash - # a simple helper to convert a json string to a Mash + # Convert a json string to a Mash + # + # @param [String] json_string + # @return [LinkedIn::Mash] def self.from_json(json_string) result_hash = ::MultiJson.decode(json_string) new(result_hash) end - # returns a Date if we have year, month and day, and no conflicting key + # Returns a Date if we have year, month and day, and no conflicting key + # + # @return [Date] def to_date if !self.has_key?('to_date') && contains_date_fields? Date.civil(self.year, self.month, self.day) @@ -19,6 +27,9 @@ def to_date end end + # Returns the id of the object from LinkedIn + # + # @return [String] def id if self['id'] self['id'] @@ -27,6 +38,9 @@ def id end end + # Convert the 'timestamp' field from a string to a Time object + # + # @return [Time] def timestamp value = self['timestamp'] if value.kind_of? Integer @@ -37,6 +51,9 @@ def timestamp end end + # Return the results array from the query + # + # @return [Array] def all super || [] end diff --git a/lib/linked_in/search.rb b/lib/linked_in/search.rb index 1edc7e16..2cf3f821 100644 --- a/lib/linked_in/search.rb +++ b/lib/linked_in/search.rb @@ -1,6 +1,21 @@ module LinkedIn module Search + + # Retrieve search results of the given object type + # + # Permissions: (for people search only) r_network + # + # @note People Search API is a part of the Vetted API Access Program. You + # must apply and get approval before using this API + # + # @see http://developer.linkedin.com/documents/people-search-api People Search + # @see http://developer.linkedin.com/documents/job-search-api Job Search + # @see http://developer.linkedin.com/documents/company-search Company Search + # + # @param [Hash] options search input fields + # @param [String] type type of object to return ('people', 'job' or 'company') + # @return [LinkedIn::Mash] def search(options={}, type='people') path = "/#{type.to_s}-search" @@ -53,4 +68,4 @@ def field_selector(fields) end end -end \ No newline at end of file +end From b1f7de28e865a8e58258e4790286af2724d6d425 Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 10:57:16 -0500 Subject: [PATCH 069/117] Re-organize modules under Api namespace Match organization in LinkedIn's REST API Documentation: http://developer.linkedin.com/rest --- lib/linked_in/api.rb | 9 +- lib/linked_in/api/communications.rb | 43 +++ lib/linked_in/api/companies.rb | 127 +++++++ lib/linked_in/api/groups.rb | 115 +++++++ lib/linked_in/api/jobs.rb | 64 ++++ lib/linked_in/api/people.rb | 46 +++ lib/linked_in/api/query_helpers.rb | 86 +++++ lib/linked_in/api/query_methods.rb | 339 ------------------- lib/linked_in/api/share_and_social_stream.rb | 132 ++++++++ lib/linked_in/api/update_methods.rb | 181 ---------- lib/linked_in/client.rb | 9 +- 11 files changed, 627 insertions(+), 524 deletions(-) create mode 100644 lib/linked_in/api/communications.rb create mode 100644 lib/linked_in/api/companies.rb create mode 100644 lib/linked_in/api/groups.rb create mode 100644 lib/linked_in/api/jobs.rb create mode 100644 lib/linked_in/api/people.rb create mode 100644 lib/linked_in/api/query_helpers.rb delete mode 100644 lib/linked_in/api/query_methods.rb create mode 100644 lib/linked_in/api/share_and_social_stream.rb delete mode 100644 lib/linked_in/api/update_methods.rb diff --git a/lib/linked_in/api.rb b/lib/linked_in/api.rb index 12d8e369..224ba8ad 100644 --- a/lib/linked_in/api.rb +++ b/lib/linked_in/api.rb @@ -26,7 +26,12 @@ module Api # @option share [String] :visibility # @option share [String] :code - autoload :QueryMethods, "linked_in/api/query_methods" - autoload :UpdateMethods, "linked_in/api/update_methods" + autoload :QueryHelpers, "linked_in/api/query_helpers" + autoload :People, "linked_in/api/people" + autoload :Groups, "linked_in/api/groups" + autoload :Companies, "linked_in/api/companies" + autoload :Jobs, "linked_in/api/jobs" + autoload :ShareAndSocialStream, "linked_in/api/share_and_social_stream" + autoload :Communications, "linked_in/api/communications" end end diff --git a/lib/linked_in/api/communications.rb b/lib/linked_in/api/communications.rb new file mode 100644 index 00000000..caa0ee82 --- /dev/null +++ b/lib/linked_in/api/communications.rb @@ -0,0 +1,43 @@ +module LinkedIn + module Api + + # Communications APIs + # + # @see http://developer.linkedin.com/documents/communications + module Communications + + # (Create) send a message from the authenticated user to a + # connection + # + # Permissions: w_messages + # + # @see http://developer.linkedin.com/documents/messaging-between-connections-api + # + # @example + # client.send_message("subject", "body", ["person_1_id", "person_2_id"]) + # + # @param [String] subject Subject of the message + # @param [String] body Body of the message, plain text only + # @param [Array] recipient_paths a collection of + # profile paths that identify the users who will receive the + # message + # @return [void] + def send_message(subject, body, recipient_paths) + path = "/people/~/mailbox" + + message = { + 'subject' => subject, + 'body' => body, + 'recipients' => { + 'values' => recipient_paths.map do |profile_path| + { 'person' => { '_path' => "/people/#{profile_path}" } } + end + } + } + post(path, message.to_json, "Content-Type" => "application/json") + end + + end + + end +end diff --git a/lib/linked_in/api/companies.rb b/lib/linked_in/api/companies.rb new file mode 100644 index 00000000..e3d1765e --- /dev/null +++ b/lib/linked_in/api/companies.rb @@ -0,0 +1,127 @@ +module LinkedIn + module Api + + # Companies API + # + # @see http://developer.linkedin.com/documents/companies Companies API + # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields Company Fields + # + # The following API actions do not have corresponding methods in + # this module + # + # * Permissions Checking Endpoints for Company Shares + # * GET Suggested Companies to Follow + # * GET Company Products + # + # [(contribute here)](https://github.com/hexgnu/linkedin) + module Companies + + # Retrieve a Company Profile + # + # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields + # + # @macro company_path_options + # @option options [String] :scope + # @option options [String] :type + # @option options [String] :count + # @option options [String] :start + # @return [LinkedIn::Mash] + def company(options = {}) + path = company_path(options) + simple_query(path, options) + end + + # Retrieve a feed of event items for a Company + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @macro company_path_options + # @option options [String] :event_type + # @option options [String] :count + # @option options [String] :start + # @return [LinkedIn::Mash] + def company_updates(options={}) + path = "#{company_path(options)}/updates" + simple_query(path, options) + end + + # Retrieve statistics for a particular company page + # + # Permissions: rw_company_admin + # + # @see http://developer.linkedin.com/documents/company-statistics + # + # @macro company_path_options + # @return [LinkedIn::Mash] + def company_statistics(options={}) + path = "#{company_path(options)}/company-statistics" + simple_query(path, options) + end + + # Retrieve comments on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [String] update_key a update/update-key representing a + # particular company update + # @macro company_path_options + # @return [LinkedIn::Mash] + def company_updates_comments(update_key, options={}) + path = "#{company_path(options)}/updates/key=#{update_key}/update-comments" + simple_query(path, options) + end + + # Retrieve likes on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [String] update_key a update/update-key representing a + # particular company update + # @macro company_path_options + # @return [LinkedIn::Mash] + def company_updates_likes(update_key, options={}) + path = "#{company_path(options)}/updates/key=#{update_key}/likes" + simple_query(path, options) + end + + # Create a share for a company that the authenticated user + # administers + # + # Permissions: rw_company_admin + # + # @see http://developer.linkedin.com/creating-company-shares + # + # @param [String] company_id Company ID + # @macro share_input_fields + # @return [void] + def add_company_share(company_id, share) + path = "/companies/#{company_id}/shares" + defaults = {:visibility => {:code => "anyone"}} + post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") + end + + # (Create) authenticated user starts following a company + # + # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # + # @param [String] company_id Company ID + # @return [void] + def follow_company(company_id) + path = "/people/~/following/companies" + body = {:id => company_id } + post(path, body.to_json, "Content-Type" => "application/json") + end + + # (Destroy) authenticated user stops following a company + # + # @see http://developer.linkedin.com/documents/company-follow-and-suggestions + # + # @param [String] company_id Company ID + # @return [void] + def unfollow_company(company_id) + path = "/people/~/following/companies/id=#{company_id}" + delete(path) + end + end + end +end diff --git a/lib/linked_in/api/groups.rb b/lib/linked_in/api/groups.rb new file mode 100644 index 00000000..bfe64219 --- /dev/null +++ b/lib/linked_in/api/groups.rb @@ -0,0 +1,115 @@ +module LinkedIn + module Api + + # Groups API + # + # @see http://developer.linkedin.com/documents/groups-api Groups API + # @see http://developer.linkedin.com/documents/groups-fields Groups Fields + # + # The following API actions do not have corresponding methods in + # this module + # + # * PUT Change my Group Settings + # * POST Change my Group Settings + # * DELETE Leave a group + # * PUT Follow/unfollow a Group post + # * PUT Flag a Post as a Promotion or Job + # * DELETE Delete a Post + # * DELETE Flag a post as inappropriate + # * DELETE A comment or flag comment as inappropriate + # * DELETE Remove a Group Suggestion + # + # [(contribute here)](https://github.com/hexgnu/linkedin) + module Groups + + # Retrieve group suggestions for the current user + # + # Permissions: r_fullprofile + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] + def group_suggestions(options = {}) + path = "#{person_path(options)}/suggestions/groups" + simple_query(path, options) + end + + # Retrieve the groups a current user belongs to + # + # Permissions: rw_groups + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @macro person_path_options + # @return [LinkedIn::Mash] + def group_memberships(options = {}) + path = "#{person_path(options)}/group-memberships" + simple_query(path, options) + end + + # Retrieve the profile of a group + # + # Permissions: rw_groups TODO + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @param [Hash] options identifies the group or groups + # @optio options [String] :id identifier for the group + # @return [LinkedIn::Mash] + def group_profile(options) + path = group_path(options) + simple_query(path, options) + end + + # Retrieve the posts in a group + # + # Permissions: rw_groups TODO + # + # @see http://developer.linkedin.com/documents/groups-api + # + # @param [Hash] options identifies the group or groups + # @optio options [String] :id identifier for the group + # @optio options [String] :count + # @optio options [String] :start + # @return [LinkedIn::Mash] + def group_posts(options) + path = "#{group_path(options)}/posts" + simple_query(path, options) + end + + # @deprecated Use {#add_group_share} instead + def post_group_discussion(group_id, discussion) + warn 'Use add_group_share over post_group_discussion. This will be taken out in future versions' + add_group_share(group_id, discussion) + end + + # Create a share for a company that the authenticated user + # administers + # + # Permissions: rw_groups + # + # @see http://developer.linkedin.com/documents/groups-api#create + # + # @param [String] group_id Group ID + # @macro share_input_fields + # @return [void] + def add_group_share(group_id, share) + path = "/groups/#{group_id}/posts" + post(path, share.to_json, "Content-Type" => "application/json") + end + + # (Update) User joins, or requests to join, a group + # + # @see http://developer.linkedin.com/documents/groups-api#membergroups + # + # @param [String] group_id Group ID + # @return [void] + def join_group(group_id) + path = "/people/~/group-memberships/#{group_id}" + body = {'membership-state' => {'code' => 'member' }} + put(path, body.to_json, "Content-Type" => "application/json") + end + end + end +end diff --git a/lib/linked_in/api/jobs.rb b/lib/linked_in/api/jobs.rb new file mode 100644 index 00000000..0d9d2757 --- /dev/null +++ b/lib/linked_in/api/jobs.rb @@ -0,0 +1,64 @@ +module LinkedIn + module Api + + # Jobs API + # + # @see http://developer.linkedin.com/documents/job-lookup-api-and-fields Job Lookup API and Fields + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions Job Bookmarks and Suggestions + # + # The following API actions do not have corresponding methods in + # this module + # + # * DELETE a Job Bookmark + # + # [(contribute here)](https://github.com/hexgnu/linkedin) + module Jobs + + # Retrieve likes on a particular company update: + # + # @see http://developer.linkedin.com/reading-company-shares + # + # @param [Hash] options identifies the job + # @option options [String] id unique identifier for a job + # @return [LinkedIn::Mash] + def job(options = {}) + path = jobs_path(options) + simple_query(path, options) + end + + # Retrieve the current members' job bookmarks + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] + def job_bookmarks(options = {}) + path = "#{person_path(options)}/job-bookmarks" + simple_query(path, options) + end + + # Retrieve job suggestions for the current user + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @macro person_path_options + # @return [LinkedIn::Mash] + def job_suggestions(options = {}) + path = "#{person_path(options)}/suggestions/job-suggestions" + simple_query(path, options) + end + + # Create a job bookmark for the authenticated user + # + # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions + # + # @param [String] bookmark Job ID + # @return [void] + def add_job_bookmark(bookmark) + path = "/people/~/job-bookmarks" + body = {'job' => {'id' => bookmark}} + post(path, body.to_json, "Content-Type" => "application/json") + end + end + end +end diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb new file mode 100644 index 00000000..25d061eb --- /dev/null +++ b/lib/linked_in/api/people.rb @@ -0,0 +1,46 @@ +module LinkedIn + module Api + + # People APIs + # + # @see http://developer.linkedin.com/documents/people People API + # @see http://developer.linkedin.com/documents/profile-fields Profile Fields + # @see http://developer.linkedin.com/documents/field-selectors Field Selectors + module People + + # Retrieve a member's LinkedIn profile. + # + # Permissions: r_basicprofile, r_fullprofile + # + # @see http://developer.linkedin.com/documents/profile-api + # @macro person_path_options + # @return [LinkedIn::Mash] + def profile(options={}) + path = person_path(options) + simple_query(path, options) + end + + # Retrieve a list of 1st degree connections for a user who has + # granted access to his/her account + # + # Permissions: r_network + # + # @see http://developer.linkedin.com/documents/connections-api + # + # @macro person_path_options + # @return [LinkedIn::Mash] + def connections(options={}) + path = "#{person_path(options)}/connections" + simple_query(path, options) + end + + # TODO can't find this method in the REST API documentation and it + # doesn't seem to work when I tried it out from the command line + def picture_urls(options={}) + picture_size = options.delete(:picture_size) || 'original' + path = "#{picture_urls_path(options)}::(#{picture_size})" + simple_query(path, options) + end + end + end +end diff --git a/lib/linked_in/api/query_helpers.rb b/lib/linked_in/api/query_helpers.rb new file mode 100644 index 00000000..93b36385 --- /dev/null +++ b/lib/linked_in/api/query_helpers.rb @@ -0,0 +1,86 @@ +module LinkedIn + module Api + + module QueryHelpers + private + + def group_path(options) + path = "/groups" + if id = options.delete(:id) + path += "/#{id}" + end + end + + def simple_query(path, options={}) + fields = options.delete(:fields) || LinkedIn.default_profile_fields + + if options.delete(:public) + path +=":public" + elsif fields + path +=":(#{build_fields_params(fields)})" + end + + headers = options.delete(:headers) || {} + params = to_query(options) + path += "#{path.include?("?") ? "&" : "?"}#{params}" if !params.empty? + + Mash.from_json(get(path, headers)) + end + + def build_fields_params(fields) + if fields.is_a?(Hash) && !fields.empty? + fields.map {|index,value| "#{index}:(#{build_fields_params(value)})" }.join(',') + elsif fields.respond_to?(:each) + fields.map {|field| build_fields_params(field) }.join(',') + else + fields.to_s.gsub("_", "-") + end + end + + def person_path(options) + path = "/people" + if id = options.delete(:id) + path += "/id=#{id}" + elsif url = options.delete(:url) + path += "/url=#{CGI.escape(url)}" + elsif email = options.delete(:email) + path += "::(#{email})" + else + path += "/~" + end + end + + def company_path(options) + path = "/companies" + + if domain = options.delete(:domain) + path += "?email-domain=#{CGI.escape(domain)}" + elsif id = options.delete(:id) + path += "/id=#{id}" + elsif url = options.delete(:url) + path += "/url=#{CGI.escape(url)}" + elsif name = options.delete(:name) + path += "/universal-name=#{CGI.escape(name)}" + elsif is_admin = options.delete(:is_admin) + path += "?is-company-admin=#{CGI.escape(is_admin)}" + else + path += "/~" + end + end + + def picture_urls_path(options) + path = person_path(options) + path += "/picture-urls" + end + + def jobs_path(options) + path = "/jobs" + if id = options.delete(:id) + path += "/id=#{id}" + else + path += "/~" + end + end + end + end +end diff --git a/lib/linked_in/api/query_methods.rb b/lib/linked_in/api/query_methods.rb deleted file mode 100644 index 610f8b31..00000000 --- a/lib/linked_in/api/query_methods.rb +++ /dev/null @@ -1,339 +0,0 @@ -module LinkedIn - module Api - - module QueryMethods - - # Retrieve a member's LinkedIn profile. - # - # Permissions: r_basicprofile, r_fullprofile - # - # @see http://developer.linkedin.com/documents/profile-api - # @macro person_path_options - # @return [LinkedIn::Mash] - def profile(options={}) - path = person_path(options) - simple_query(path, options) - end - - # Retrieve a list of 1st degree connections for a user who has - # granted access to his/her account - # - # Permissions: r_network - # - # @see http://developer.linkedin.com/documents/connections-api - # - # @macro person_path_options - # @return [LinkedIn::Mash] - def connections(options={}) - path = "#{person_path(options)}/connections" - simple_query(path, options) - end - - # Retrieve the authenticated users network updates - # - # TODO Permissions? - # - # @see http://developer.linkedin.com/documents/get-network-updates-and-statistics-api - # - # @macro person_path_options - # @option options [String] :scope - # @option options [String] :type - # @option options [String] :count - # @option options [String] :start - # @option options [String] :after - # @option options [String] :before - # @option options [String] :show-hidden-members - # @return [LinkedIn::Mash] - def network_updates(options={}) - path = "#{person_path(options)}/network/updates" - simple_query(path, options) - end - - # Retrieve a Company Profile - # - # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields - # - # @macro company_path_options - # @option options [String] :scope - # @option options [String] :type - # @option options [String] :count - # @option options [String] :start - # @return [LinkedIn::Mash] - def company(options = {}) - path = company_path(options) - simple_query(path, options) - end - - # Retrieve a feed of event items for a Company - # - # @see http://developer.linkedin.com/reading-company-shares - # - # @macro company_path_options - # @option options [String] :event_type - # @option options [String] :count - # @option options [String] :start - # @return [LinkedIn::Mash] - def company_updates(options={}) - path = "#{company_path(options)}/updates" - simple_query(path, options) - end - - # Retrieve statistics for a particular company page - # - # Permissions: rw_company_admin - # - # @see http://developer.linkedin.com/documents/company-statistics - # - # @macro company_path_options - # @return [LinkedIn::Mash] - def company_statistics(options={}) - path = "#{company_path(options)}/company-statistics" - simple_query(path, options) - end - - # Retrieve comments on a particular company update: - # - # @see http://developer.linkedin.com/reading-company-shares - # - # @param [String] update_key a update/update-key representing a - # particular company update - # @macro company_path_options - # @return [LinkedIn::Mash] - def company_updates_comments(update_key, options={}) - path = "#{company_path(options)}/updates/key=#{update_key}/update-comments" - simple_query(path, options) - end - - # Retrieve likes on a particular company update: - # - # @see http://developer.linkedin.com/reading-company-shares - # - # @param [String] update_key a update/update-key representing a - # particular company update - # @macro company_path_options - # @return [LinkedIn::Mash] - def company_updates_likes(update_key, options={}) - path = "#{company_path(options)}/updates/key=#{update_key}/likes" - simple_query(path, options) - end - - # Retrieve likes on a particular company update: - # - # @see http://developer.linkedin.com/reading-company-shares - # - # @param [Hash] options identifies the job - # @option options [String] id unique identifier for a job - # @return [LinkedIn::Mash] - def job(options = {}) - path = jobs_path(options) - simple_query(path, options) - end - - # Retrieve the current members' job bookmarks - # - # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions - # - # @macro person_path_options - # @return [LinkedIn::Mash] - def job_bookmarks(options = {}) - path = "#{person_path(options)}/job-bookmarks" - simple_query(path, options) - end - - # Retrieve job suggestions for the current user - # - # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions - # - # @macro person_path_options - # @return [LinkedIn::Mash] - def job_suggestions(options = {}) - path = "#{person_path(options)}/suggestions/job-suggestions" - simple_query(path, options) - end - - # Retrieve job suggestions for the current user - # - # Permissions: r_fullprofile - # - # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions - # - # @macro person_path_options - # @return [LinkedIn::Mash] - def group_suggestions(options = {}) - path = "#{person_path(options)}/suggestions/groups" - simple_query(path, options) - end - - # Retrieve the groups a current user belongs to - # - # Permissions: rw_groups - # - # @see http://developer.linkedin.com/documents/groups-api - # - # @macro person_path_options - # @return [LinkedIn::Mash] - def group_memberships(options = {}) - path = "#{person_path(options)}/group-memberships" - simple_query(path, options) - end - - # Retrieve the profile of a group - # - # Permissions: rw_groups TODO - # - # @see http://developer.linkedin.com/documents/groups-api - # - # @param [Hash] options identifies the group or groups - # @optio options [String] :id identifier for the group - # @return [LinkedIn::Mash] - def group_profile(options) - path = group_path(options) - simple_query(path, options) - end - - # Retrieve the posts in a group - # - # Permissions: rw_groups TODO - # - # @see http://developer.linkedin.com/documents/groups-api - # - # @param [Hash] options identifies the group or groups - # @optio options [String] :id identifier for the group - # @optio options [String] :count - # @optio options [String] :start - # @return [LinkedIn::Mash] - def group_posts(options) - path = "#{group_path(options)}/posts" - simple_query(path, options) - end - - # TODO refactor to use #network_updates - def shares(options={}) - path = "#{person_path(options)}/network/updates" - simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) - end - - # Retrieve all comments for a particular network update - # - # @note The first 5 comments are included in the response to #network_updates - # - # TODO Permissions? rw_nus? - # - # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates - # - # @param [String] update_key a update/update-key representing a - # particular network update - # @macro person_path_options - # @return [LinkedIn::Mash] - def share_comments(update_key, options={}) - path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments" - simple_query(path, options) - end - - # Retrieve all likes for a particular network update - # - # @note Some likes are included in the response to #network_updates - # - # TODO Permissions? rw_nus? - # - # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates - # - # @param [String] update_key a update/update-key representing a - # particular network update - # @macro person_path_options - # @return [LinkedIn::Mash] - def share_likes(update_key, options={}) - path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" - simple_query(path, options) - end - - # TODO can't find this method in the REST API documentation and it - # doesn't seem to work when I tried it out from the command line - def picture_urls(options={}) - picture_size = options.delete(:picture_size) || 'original' - path = "#{picture_urls_path(options)}::(#{picture_size})" - simple_query(path, options) - end - - private - - def group_path(options) - path = "/groups" - if id = options.delete(:id) - path += "/#{id}" - end - end - - def simple_query(path, options={}) - fields = options.delete(:fields) || LinkedIn.default_profile_fields - - if options.delete(:public) - path +=":public" - elsif fields - path +=":(#{build_fields_params(fields)})" - end - - headers = options.delete(:headers) || {} - params = to_query(options) - path += "#{path.include?("?") ? "&" : "?"}#{params}" if !params.empty? - - Mash.from_json(get(path, headers)) - end - - def build_fields_params(fields) - if fields.is_a?(Hash) && !fields.empty? - fields.map {|index,value| "#{index}:(#{build_fields_params(value)})" }.join(',') - elsif fields.respond_to?(:each) - fields.map {|field| build_fields_params(field) }.join(',') - else - fields.to_s.gsub("_", "-") - end - end - - def person_path(options) - path = "/people" - if id = options.delete(:id) - path += "/id=#{id}" - elsif url = options.delete(:url) - path += "/url=#{CGI.escape(url)}" - elsif email = options.delete(:email) - path += "::(#{email})" - else - path += "/~" - end - end - - def company_path(options) - path = "/companies" - - if domain = options.delete(:domain) - path += "?email-domain=#{CGI.escape(domain)}" - elsif id = options.delete(:id) - path += "/id=#{id}" - elsif url = options.delete(:url) - path += "/url=#{CGI.escape(url)}" - elsif name = options.delete(:name) - path += "/universal-name=#{CGI.escape(name)}" - elsif is_admin = options.delete(:is_admin) - path += "?is-company-admin=#{CGI.escape(is_admin)}" - else - path += "/~" - end - end - - def picture_urls_path(options) - path = person_path(options) - path += "/picture-urls" - end - - def jobs_path(options) - path = "/jobs" - if id = options.delete(:id) - path += "/id=#{id}" - else - path += "/~" - end - end - end - end -end diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb new file mode 100644 index 00000000..cae0b8cf --- /dev/null +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -0,0 +1,132 @@ +module LinkedIn + module Api + + # Share and Social Stream APIs + # + # @see http://developer.linkedin.com/documents/share-and-social-stream + # @see http://developer.linkedin.com/documents/share-api Share API + # + # The following API actions do not have corresponding methods in + # this module + # + # * GET Network Statistics + # * POST Post Network Update + # + # [(contribute here)](https://github.com/hexgnu/linkedin) + module ShareAndSocialStream + + # Retrieve the authenticated users network updates + # + # TODO Permissions? + # + # @see http://developer.linkedin.com/documents/get-network-updates-and-statistics-api + # + # @macro person_path_options + # @option options [String] :scope + # @option options [String] :type + # @option options [String] :count + # @option options [String] :start + # @option options [String] :after + # @option options [String] :before + # @option options [String] :show-hidden-members + # @return [LinkedIn::Mash] + def network_updates(options={}) + path = "#{person_path(options)}/network/updates" + simple_query(path, options) + end + + # TODO refactor to use #network_updates + def shares(options={}) + path = "#{person_path(options)}/network/updates" + simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) + end + + # Retrieve all comments for a particular network update + # + # @note The first 5 comments are included in the response to #network_updates + # + # TODO Permissions? rw_nus? + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] update_key a update/update-key representing a + # particular network update + # @macro person_path_options + # @return [LinkedIn::Mash] + def share_comments(update_key, options={}) + path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments" + simple_query(path, options) + end + + # Retrieve all likes for a particular network update + # + # @note Some likes are included in the response to #network_updates + # + # TODO Permissions? rw_nus? + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] update_key a update/update-key representing a + # particular network update + # @macro person_path_options + # @return [LinkedIn::Mash] + def share_likes(update_key, options={}) + path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" + simple_query(path, options) + end + + # Create a share for the authenticated user + # + # Permissions: rw_nus + # + # @see http://developer.linkedin.com/documents/share-api + # + # @macro share_input_fields + # @return [void] + def add_share(share) + path = "/people/~/shares" + defaults = {:visibility => {:code => "anyone"}} + post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") + end + + # Create a comment on an update from the authenticated user + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @param [String] comment The text of the comment + # @return [void] + def update_comment(network_key, comment) + path = "/people/~/network/updates/key=#{network_key}/update-comments" + body = {'comment' => comment} + post(path, body.to_json, "Content-Type" => "application/json") + end + + # (Update) like an update as the authenticated user + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @return [void] + def like_share(network_key) + path = "/people/~/network/updates/key=#{network_key}/is-liked" + put(path, 'true', "Content-Type" => "application/json") + end + + # (Destroy) unlike an update the authenticated user previously + # liked + # + # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates + # + # @param [String] network_key a update/update-key representing a + # particular network update + # @return [void] + def unlike_share(network_key) + path = "/people/~/network/updates/key=#{network_key}/is-liked" + put(path, 'false', "Content-Type" => "application/json") + end + end + end +end diff --git a/lib/linked_in/api/update_methods.rb b/lib/linked_in/api/update_methods.rb deleted file mode 100644 index 60639213..00000000 --- a/lib/linked_in/api/update_methods.rb +++ /dev/null @@ -1,181 +0,0 @@ -module LinkedIn - module Api - - module UpdateMethods - - # Create a share for the authenticated user - # - # Permissions: rw_nus - # - # @see http://developer.linkedin.com/documents/share-api - # - # @macro share_input_fields - # @return [void] - def add_share(share) - path = "/people/~/shares" - defaults = {:visibility => {:code => "anyone"}} - post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") - end - - # Create a share for a company that the authenticated user - # administers - # - # Permissions: rw_company_admin - # - # @see http://developer.linkedin.com/creating-company-shares - # - # @param [String] company_id Company ID - # @macro share_input_fields - # @return [void] - def add_company_share(company_id, share) - path = "/companies/#{company_id}/shares" - defaults = {:visibility => {:code => "anyone"}} - post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") - end - - # @deprecated Use {#add_group_share} instead - def post_group_discussion(group_id, discussion) - warn 'Use add_group_share over post_group_discussion. This will be taken out in future versions' - add_group_share(group_id, discussion) - end - - # Create a share for a company that the authenticated user - # administers - # - # Permissions: rw_groups - # - # @see http://developer.linkedin.com/documents/groups-api#create - # - # @param [String] group_id Group ID - # @macro share_input_fields - # @return [void] - def add_group_share(group_id, share) - path = "/groups/#{group_id}/posts" - post(path, share.to_json, "Content-Type" => "application/json") - end - - # (Create) authenticated user starts following a company - # - # @see http://developer.linkedin.com/documents/company-follow-and-suggestions - # - # @param [String] company_id Company ID - # @return [void] - def follow_company(company_id) - path = "/people/~/following/companies" - body = {:id => company_id } - post(path, body.to_json, "Content-Type" => "application/json") - end - - # (Destroy) authenticated user stops following a company - # - # @see http://developer.linkedin.com/documents/company-follow-and-suggestions - # - # @param [String] company_id Company ID - # @return [void] - def unfollow_company(company_id) - path = "/people/~/following/companies/id=#{company_id}" - delete(path) - end - - # (Update) User joins, or requests to join, a group - # - # @see http://developer.linkedin.com/documents/groups-api#membergroups - # - # @param [String] group_id Group ID - # @return [void] - def join_group(group_id) - path = "/people/~/group-memberships/#{group_id}" - body = {'membership-state' => {'code' => 'member' }} - put(path, body.to_json, "Content-Type" => "application/json") - end - - # Create a job bookmark for the authenticated user - # - # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions - # - # @param [String] bookmark Job ID - # @return [void] - def add_job_bookmark(bookmark) - path = "/people/~/job-bookmarks" - body = {'job' => {'id' => bookmark}} - post(path, body.to_json, "Content-Type" => "application/json") - end - - # Create a comment on an update from the authenticated user - # - # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates - # - # @param [String] network_key a update/update-key representing a - # particular network update - # @param [String] comment The text of the comment - # @return [void] - def update_comment(network_key, comment) - path = "/people/~/network/updates/key=#{network_key}/update-comments" - body = {'comment' => comment} - post(path, body.to_json, "Content-Type" => "application/json") - end - - # (Update) like an update as the authenticated user - # - # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates - # - # @param [String] network_key a update/update-key representing a - # particular network update - # @return [void] - def like_share(network_key) - path = "/people/~/network/updates/key=#{network_key}/is-liked" - put(path, 'true', "Content-Type" => "application/json") - end - - # (Destroy) unlike an update the authenticated user previously - # liked - # - # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates - # - # @param [String] network_key a update/update-key representing a - # particular network update - # @return [void] - def unlike_share(network_key) - path = "/people/~/network/updates/key=#{network_key}/is-liked" - put(path, 'false', "Content-Type" => "application/json") - end - - # (Create) send a message from the authenticated user to a - # connection - # - # Permissions: w_messages - # - # @see http://developer.linkedin.com/documents/messaging-between-connections-api - # - # @example - # client.send_message( - # 'What's New?', - # 'Hi, what is going on with you two?', - # ['id=1234', 'id=5678'] - # ) - # - # @param [String] subject Subject of the message - # @param [String] body Body of the message, plain text only - # @param [Array] recipient_paths a collection of - # profile paths that identify the users who will receive the - # message - # @return [void] - def send_message(subject, body, recipient_paths) - path = "/people/~/mailbox" - - message = { - 'subject' => subject, - 'body' => body, - 'recipients' => { - 'values' => recipient_paths.map do |profile_path| - { 'person' => { '_path' => "/people/#{profile_path}" } } - end - } - } - post(path, message.to_json, "Content-Type" => "application/json") - end - - end - - end -end diff --git a/lib/linked_in/client.rb b/lib/linked_in/client.rb index fdf99dca..645f196d 100644 --- a/lib/linked_in/client.rb +++ b/lib/linked_in/client.rb @@ -5,8 +5,13 @@ module LinkedIn class Client include Helpers::Request include Helpers::Authorization - include Api::QueryMethods - include Api::UpdateMethods + include Api::QueryHelpers + include Api::People + include Api::Groups + include Api::Companies + include Api::Jobs + include Api::ShareAndSocialStream + include Api::Communications include Search attr_reader :consumer_token, :consumer_secret, :consumer_options From e726c81e074a9d4062577f23314138319ded4ead Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 11:04:17 -0500 Subject: [PATCH 070/117] Review and edit documentation --- lib/linked_in/api.rb | 11 ++++++----- lib/linked_in/api/communications.rb | 1 + lib/linked_in/api/companies.rb | 3 ++- lib/linked_in/api/groups.rb | 4 ++-- lib/linked_in/api/people.rb | 2 ++ lib/linked_in/api/share_and_social_stream.rb | 7 ++++--- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/linked_in/api.rb b/lib/linked_in/api.rb index 224ba8ad..84aaf432 100644 --- a/lib/linked_in/api.rb +++ b/lib/linked_in/api.rb @@ -5,23 +5,24 @@ module Api # @param [Hash] options identifies the user profile you want # @option options [String] :id a member token # @option options [String] :url a Public Profile URL - # @option options [String] :email TODO + # @option options [String] :email # @!macro company_path_options # @param [Hash] options identifies the user profile you want # @option options [String] :domain company email domain # @option options [String] :id company ID - # @option options [String] :url TODO + # @option options [String] :url # @option options [String] :name company universal name - # @option options [String] :is_admin TODO + # @option options [String] :is_admin list all companies that the + # authenticated is an administrator of # @!macro share_input_fields # @param [Hash] share content of the share # @option share [String] :comment # @option share [String] :content # @option share [String] :title - # @option share [String] :submitted_url TODO - # @option share [String] :submitted_image_url TODO + # @option share [String] :submitted-url + # @option share [String] :submitted-image-url # @option share [String] :description # @option share [String] :visibility # @option share [String] :code diff --git a/lib/linked_in/api/communications.rb b/lib/linked_in/api/communications.rb index caa0ee82..8e67f692 100644 --- a/lib/linked_in/api/communications.rb +++ b/lib/linked_in/api/communications.rb @@ -12,6 +12,7 @@ module Communications # Permissions: w_messages # # @see http://developer.linkedin.com/documents/messaging-between-connections-api + # @see http://developer.linkedin.com/documents/invitation-api Invitation API # # @example # client.send_message("subject", "body", ["person_1_id", "person_2_id"]) diff --git a/lib/linked_in/api/companies.rb b/lib/linked_in/api/companies.rb index e3d1765e..eec67e77 100644 --- a/lib/linked_in/api/companies.rb +++ b/lib/linked_in/api/companies.rb @@ -36,7 +36,7 @@ def company(options = {}) # @see http://developer.linkedin.com/reading-company-shares # # @macro company_path_options - # @option options [String] :event_type + # @option options [String] :event-type # @option options [String] :count # @option options [String] :start # @return [LinkedIn::Mash] @@ -90,6 +90,7 @@ def company_updates_likes(update_key, options={}) # Permissions: rw_company_admin # # @see http://developer.linkedin.com/creating-company-shares + # @see http://developer.linkedin.com/documents/targeting-company-shares Targeting Company Shares # # @param [String] company_id Company ID # @macro share_input_fields diff --git a/lib/linked_in/api/groups.rb b/lib/linked_in/api/groups.rb index bfe64219..d0656ee4 100644 --- a/lib/linked_in/api/groups.rb +++ b/lib/linked_in/api/groups.rb @@ -50,7 +50,7 @@ def group_memberships(options = {}) # Retrieve the profile of a group # - # Permissions: rw_groups TODO + # Permissions: rw_groups # # @see http://developer.linkedin.com/documents/groups-api # @@ -64,7 +64,7 @@ def group_profile(options) # Retrieve the posts in a group # - # Permissions: rw_groups TODO + # Permissions: rw_groups # # @see http://developer.linkedin.com/documents/groups-api # diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index 25d061eb..d50a0cbd 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -6,6 +6,7 @@ module Api # @see http://developer.linkedin.com/documents/people People API # @see http://developer.linkedin.com/documents/profile-fields Profile Fields # @see http://developer.linkedin.com/documents/field-selectors Field Selectors + # @see http://developer.linkedin.com/documents/accessing-out-network-profiles Accessing Out of Network Profiles module People # Retrieve a member's LinkedIn profile. @@ -14,6 +15,7 @@ module People # # @see http://developer.linkedin.com/documents/profile-api # @macro person_path_options + # @option options [string] :secure-urls if 'true' URLs in responses will be HTTPS # @return [LinkedIn::Mash] def profile(options={}) path = person_path(options) diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb index cae0b8cf..a3b6adf5 100644 --- a/lib/linked_in/api/share_and_social_stream.rb +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -17,9 +17,10 @@ module ShareAndSocialStream # Retrieve the authenticated users network updates # - # TODO Permissions? + # Permissions: rw_nus # # @see http://developer.linkedin.com/documents/get-network-updates-and-statistics-api + # @see http://developer.linkedin.com/documents/network-update-types Network Update Types # # @macro person_path_options # @option options [String] :scope @@ -45,7 +46,7 @@ def shares(options={}) # # @note The first 5 comments are included in the response to #network_updates # - # TODO Permissions? rw_nus? + # Permissions: rw_nus # # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates # @@ -62,7 +63,7 @@ def share_comments(update_key, options={}) # # @note Some likes are included in the response to #network_updates # - # TODO Permissions? rw_nus? + # Permissions: rw_nus # # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates # From b4168610b70e133a32dd8846ab5aab506eba987c Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 11:48:40 -0500 Subject: [PATCH 071/117] Use consistent and revealing arugment names Clarify #add_job_bookmark argument and set convention of using 'update_key' as the argument name --- lib/linked_in/api/jobs.rb | 6 +++--- lib/linked_in/api/share_and_social_stream.rb | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/linked_in/api/jobs.rb b/lib/linked_in/api/jobs.rb index 0d9d2757..50024193 100644 --- a/lib/linked_in/api/jobs.rb +++ b/lib/linked_in/api/jobs.rb @@ -52,11 +52,11 @@ def job_suggestions(options = {}) # # @see http://developer.linkedin.com/documents/job-bookmarks-and-suggestions # - # @param [String] bookmark Job ID + # @param [String] job_id Job ID # @return [void] - def add_job_bookmark(bookmark) + def add_job_bookmark(job_id) path = "/people/~/job-bookmarks" - body = {'job' => {'id' => bookmark}} + body = {'job' => {'id' => job_id}} post(path, body.to_json, "Content-Type" => "application/json") end end diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb index a3b6adf5..060fe2be 100644 --- a/lib/linked_in/api/share_and_social_stream.rb +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -94,12 +94,12 @@ def add_share(share) # # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates # - # @param [String] network_key a update/update-key representing a + # @param [String] update_key a update/update-key representing a # particular network update # @param [String] comment The text of the comment # @return [void] - def update_comment(network_key, comment) - path = "/people/~/network/updates/key=#{network_key}/update-comments" + def update_comment(update_key, comment) + path = "/people/~/network/updates/key=#{update_key}/update-comments" body = {'comment' => comment} post(path, body.to_json, "Content-Type" => "application/json") end @@ -108,11 +108,11 @@ def update_comment(network_key, comment) # # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates # - # @param [String] network_key a update/update-key representing a + # @param [String] update_key a update/update-key representing a # particular network update # @return [void] - def like_share(network_key) - path = "/people/~/network/updates/key=#{network_key}/is-liked" + def like_share(update_key) + path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, 'true', "Content-Type" => "application/json") end @@ -121,11 +121,11 @@ def like_share(network_key) # # @see http://developer.linkedin.com/documents/commenting-reading-comments-and-likes-network-updates # - # @param [String] network_key a update/update-key representing a + # @param [String] update_key a update/update-key representing a # particular network update # @return [void] - def unlike_share(network_key) - path = "/people/~/network/updates/key=#{network_key}/is-liked" + def unlike_share(update_key) + path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, 'false', "Content-Type" => "application/json") end end From 76bf89357e2ff93223488dd3f362930029f83d1f Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 11:56:12 -0500 Subject: [PATCH 072/117] Add method for Finding New Connections --- lib/linked_in/api/people.rb | 17 +++++++++++++++++ spec/cases/api_spec.rb | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index d50a0cbd..21b50291 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -36,6 +36,23 @@ def connections(options={}) simple_query(path, options) end + # Retrieve a list of the latest set of 1st degree connections for a + # user + # + # Permissions: r_network + # + # @see http://developer.linkedin.com/documents/connections-api + # + # @param [String] modified_since timestamp indicating since when + # you want to retrieve new connections + # @macro person_path_options + # @return [LinkedIn::Mash] + def new_connections(modified_since, options={}) + options.merge!('modified' => 'new', 'modified-since' => modified_since) + path = "#{person_path(options)}/connections" + simple_query(path, options) + end + # TODO can't find this method in the REST API documentation and it # doesn't seem to work when I tried it out from the command line def picture_urls(options={}) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index a3d531a5..e5240df3 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -30,6 +30,12 @@ client.connections.should be_an_instance_of(LinkedIn::Mash) end + it "should be able to view new connections" do + modified_since = Time.now.to_i * 1000 + stub_request(:get, "https://api.linkedin.com/v1/people/~/connections?modified=new&modified-since=#{modified_since}").to_return(:body => "{}") + client.new_connections(modified_since).should be_an_instance_of(LinkedIn::Mash) + end + it "should be able to view network_updates" do stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates").to_return(:body => "{}") client.network_updates.should be_an_instance_of(LinkedIn::Mash) From 921617b44bbaf7a1192ff7f107c9618f1134d651 Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 18 Jan 2014 12:15:09 -0500 Subject: [PATCH 073/117] Convert examples to markdown pages --- README.md | 3 --- examples/{authenticate.rb => Authenticate.md} | 6 ++++++ examples/{communication.rb => Communication.md} | 10 ++++++++-- examples/{network.rb => Network.md} | 9 ++++++++- examples/{profile.rb => Profile.md} | 7 ++++++- examples/{sinatra.rb => Sinatra.md} | 7 +++++++ examples/{status.rb => UpdateStatus.md} | 6 ++++++ 7 files changed, 41 insertions(+), 7 deletions(-) rename examples/{authenticate.rb => Authenticate.md} (92%) rename examples/{communication.rb => Communication.md} (58%) rename examples/{network.rb => Network.md} (67%) rename examples/{profile.rb => Profile.md} (91%) rename examples/{sinatra.rb => Sinatra.md} (91%) rename examples/{status.rb => UpdateStatus.md} (70%) diff --git a/README.md b/README.md index 878b0a9a..7371a284 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,6 @@ client.profile(:id => 'gNma67_AdI') client.profile(:url => 'http://www.linkedin.com/in/netherland') ``` -More examples in the [examples folder](http://github.com/pengwynn/linkedin/blob/master/examples). - For a nice example on using this in a [Rails App](http://pivotallabs.com/users/will/blog/articles/1096-linkedin-gem-for-a-web-app). If you want to play with the LinkedIn api without using the gem, have a look at the [apigee LinkedIn console](http://app.apigee.com/console/linkedin). @@ -68,7 +66,6 @@ If you want to play with the LinkedIn api without using the gem, have a look at More examples are in the [examples folder](http://github.com/hexgnu/linkedin/blob/master/examples). - ## Changelog [View the Changelog](CHANGELOG.md) diff --git a/examples/authenticate.rb b/examples/Authenticate.md similarity index 92% rename from examples/authenticate.rb rename to examples/Authenticate.md index 531dfba1..91aaa4ab 100644 --- a/examples/authenticate.rb +++ b/examples/Authenticate.md @@ -1,3 +1,8 @@ +# Authenticate + +Here's an example of authenticating with the LinkedIn API + +```ruby require 'rubygems' require 'linkedin' @@ -24,3 +29,4 @@ c.authorize_from_access("OU812", "8675309") # you're now free to move about the cabin, call any API method +``` diff --git a/examples/communication.rb b/examples/Communication.md similarity index 58% rename from examples/communication.rb rename to examples/Communication.md index 4c8984ab..64dd5c4a 100644 --- a/examples/communication.rb +++ b/examples/Communication.md @@ -1,7 +1,13 @@ -# AUTHENTICATE FIRST found in examples/authenticate.rb +# Communication + +Here's an example of sending a message to two recipients + +```ruby +# AUTHENTICATE FIRST found in examples/authenticate.md # client is a LinkedIn::Client # send a message to a person in your network. you will need to authenticate the # user and ask for the "w_messages" permission. -response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) \ No newline at end of file +response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) +``` diff --git a/examples/network.rb b/examples/Network.md similarity index 67% rename from examples/network.rb rename to examples/Network.md index 2d19ae70..93a7947c 100644 --- a/examples/network.rb +++ b/examples/Network.md @@ -1,3 +1,9 @@ +# Network + +Here are some examples of accessing network updates and connections of +the authenticated user + +``` ruby # AUTHENTICATE FIRST found in examples/authenticate.rb # client is a LinkedIn::Client @@ -9,4 +15,5 @@ client.network_updates(:type => 'PICT') # view connections for the currently authenticated user -client.connections \ No newline at end of file +client.connections +``` diff --git a/examples/profile.rb b/examples/Profile.md similarity index 91% rename from examples/profile.rb rename to examples/Profile.md index 14ce65b1..50ae126a 100644 --- a/examples/profile.rb +++ b/examples/Profile.md @@ -1,3 +1,8 @@ +# Profile + +Here are some examples of accessing a user's profile + +```ruby # AUTHENTICATE FIRST found in examples/authenticate.rb # client is a LinkedIn::Client @@ -18,4 +23,4 @@ # Example of a multi-email search against the special email search API account_exists = client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => ['id']) - +``` diff --git a/examples/sinatra.rb b/examples/Sinatra.md similarity index 91% rename from examples/sinatra.rb rename to examples/Sinatra.md index e4780d04..6a3d9c18 100644 --- a/examples/sinatra.rb +++ b/examples/Sinatra.md @@ -1,3 +1,9 @@ +# Sinatra Example + +Here's an example sinatra application that performs authentication, +after which some info about the authenticated user can be retrieved. + +```ruby require "rubygems" require "haml" require "sinatra" @@ -75,3 +81,4 @@ def linkedin_client %div= "#{c.first_name} #{c.last_name} - #{c.headline}" -else %a{:href => "/auth"} Login using LinkedIn +``` diff --git a/examples/status.rb b/examples/UpdateStatus.md similarity index 70% rename from examples/status.rb rename to examples/UpdateStatus.md index 457ebe4a..b787616f 100644 --- a/examples/status.rb +++ b/examples/UpdateStatus.md @@ -1,6 +1,12 @@ +# Update Status + +Here's an example of updating the current user's status + +```ruby # AUTHENTICATE FIRST found in examples/authenticate.rb # client is a LinkedIn::Client # update status for the authenticated user client.add_share(:comment => 'is playing with the LinkedIn Ruby gem') +``` From 19f0eb5b0a1784f1ae0dbcaae95a208aca81dafe Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 25 Jan 2014 10:44:40 -0500 Subject: [PATCH 074/117] Bring all examples into 1 file --- .yardopts | 1 + EXAMPLES.md | 198 ++++++++++++++++++++++++++++++++++++++ README.md | 52 +--------- examples/Authenticate.md | 32 ------ examples/Communication.md | 13 --- examples/Network.md | 19 ---- examples/Profile.md | 26 ----- examples/Sinatra.md | 84 ---------------- examples/UpdateStatus.md | 12 --- 9 files changed, 200 insertions(+), 237 deletions(-) create mode 100644 EXAMPLES.md delete mode 100644 examples/Authenticate.md delete mode 100644 examples/Communication.md delete mode 100644 examples/Network.md delete mode 100644 examples/Profile.md delete mode 100644 examples/Sinatra.md delete mode 100644 examples/UpdateStatus.md diff --git a/.yardopts b/.yardopts index 5199c275..31f7f7ad 100644 --- a/.yardopts +++ b/.yardopts @@ -4,3 +4,4 @@ README.md CHANGELOG.md LICENSE +EXAMPLES.md diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 00000000..1ed9bdc5 --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,198 @@ +# Linkedin Gem Examples + +## OAuth 1.0a Authentication + +Here's an example of authenticating with the LinkedIn API + +```ruby +require 'rubygems' +require 'linkedin' + +# get your api keys at https://www.linkedin.com/secure/developer +client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') + +# If you want to use one of the scopes from linkedin you have to pass it in at this point +# You can learn more about it here: http://developer.linkedin.com/documents/authentication +request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") + +rtoken = request_token.token +rsecret = request_token.secret + +# to test from your desktop, open the following url in your browser +# and record the pin it gives you +request_token.authorize_url +=> "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" + +# then fetch your access keys +client.authorize_from_request(rtoken, rsecret, pin) +=> ["OU812", "8675309"] # <= save these for future requests + +# or authorize from previously fetched access keys +c.authorize_from_access("OU812", "8675309") + +# you're now free to move about the cabin, call any API method +``` + + +## Profile + +Here are some examples of accessing a user's profile + +```ruby +# AUTHENTICATE FIRST found in examples/authenticate.rb + +# client is a LinkedIn::Client + +# get the profile for the authenticated user +client.profile + +# get a profile for someone found in network via ID +client.profile(:id => 'gNma67_AdI') + +# get a profile for someone via their public profile url +client.profile(:url => 'http://www.linkedin.com/in/netherland') + +# provides the ability to access authenticated user's company field in the profile +user = client.profile(:fields => %w(positions)) +companies = user.positions.all.map{|t| t.company} +# Example: most recent company can be accessed via companies[0] + +# Example of a multi-email search against the special email search API +account_exists = client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => ['id']) +``` + + +## Sending a Message + +Here's an example of sending a message to two recipients + +```ruby +# AUTHENTICATE FIRST found in examples/authenticate.md + +# client is a LinkedIn::Client + +# send a message to a person in your network. you will need to authenticate the +# user and ask for the "w_messages" permission. +response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) +``` + + +## User's Network + +Here are some examples of accessing network updates and connections of +the authenticated user + +``` ruby +# AUTHENTICATE FIRST found in examples/authenticate.rb + +# client is a LinkedIn::Client + +# get network updates for the authenticated user +client.network_updates + +# get profile picture changes +client.network_updates(:type => 'PICT') + +# view connections for the currently authenticated user +client.connections +``` + + +## Update User's Status + +Here's an example of updating the current user's status + +```ruby +# AUTHENTICATE FIRST found in examples/authenticate.rb + +# client is a LinkedIn::Client + +# update status for the authenticated user +client.add_share(:comment => 'is playing with the LinkedIn Ruby gem') +``` + + +## Sinatra App + +Here's an example sinatra application that performs authentication, +after which some info about the authenticated user can be retrieved. + +```ruby +require "rubygems" +require "haml" +require "sinatra" +require "linkedin" + +enable :sessions + +helpers do + def login? + !session[:atoken].nil? + end + + def profile + linkedin_client.profile unless session[:atoken].nil? + end + + def connections + linkedin_client.connections unless session[:atoken].nil? + end + + private + def linkedin_client + client = LinkedIn::Client.new(settings.api, settings.secret) + client.authorize_from_access(session[:atoken], session[:asecret]) + client + end + +end + +configure do + # get your api keys at https://www.linkedin.com/secure/developer + set :api, "your_api_key" + set :secret, "your_secret" +end + +get "/" do + haml :index +end + +get "/auth" do + client = LinkedIn::Client.new(settings.api, settings.secret) + request_token = client.request_token(:oauth_callback => "http://#{request.host}:#{request.port}/auth/callback") + session[:rtoken] = request_token.token + session[:rsecret] = request_token.secret + + redirect client.request_token.authorize_url +end + +get "/auth/logout" do + session[:atoken] = nil + redirect "/" +end + +get "/auth/callback" do + client = LinkedIn::Client.new(settings.api, settings.secret) + if session[:atoken].nil? + pin = params[:oauth_verifier] + atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin) + session[:atoken] = atoken + session[:asecret] = asecret + end + redirect "/" +end + + +__END__ +@@index +-if login? + %p Welcome #{profile.first_name}! + %a{:href => "/auth/logout"} Logout + %p= profile.headline + %br + %div= "You have #{connections.total} connections!" + -connections.all.each do |c| + %div= "#{c.first_name} #{c.last_name} - #{c.headline}" +-else + %a{:href => "/auth"} Login using LinkedIn +``` diff --git a/README.md b/README.md index 7371a284..4b6d36b5 100644 --- a/README.md +++ b/README.md @@ -14,57 +14,7 @@ Documented with yard. To view documentation locally, run: `yard server` ## Usage -### Authenticate - -LinkedIn's API uses Oauth for authentication. Luckily, the LinkedIn gem hides most of the gory details from you. - -```ruby -require 'linkedin' - -# get your api keys at https://www.linkedin.com/secure/developer -client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') - -# If you want to use one of the scopes from linkedin you have to pass it in at this point -# You can learn more about it here: http://developer.linkedin.com/documents/authentication -request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") - -rtoken = request_token.token -rsecret = request_token.secret - -# to test from your desktop, open the following url in your browser -# and record the pin it gives you -request_token.authorize_url -=> "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" - -# then fetch your access keys -client.authorize_from_request(rtoken, rsecret, pin) -=> ["OU812", "8675309"] # <= save these for future requests - -# or authorize from previously fetched access keys -c.authorize_from_access("OU812", "8675309") - -# you're now free to move about the cabin, call any API method -``` - -### Profile examples -```ruby -# get the profile for the authenticated user -client.profile - -# get a profile for someone found in network via ID -client.profile(:id => 'gNma67_AdI') - -# get a profile for someone via their public profile url -client.profile(:url => 'http://www.linkedin.com/in/netherland') -``` - -For a nice example on using this in a [Rails App](http://pivotallabs.com/users/will/blog/articles/1096-linkedin-gem-for-a-web-app). - -If you want to play with the LinkedIn api without using the gem, have a look at the [apigee LinkedIn console](http://app.apigee.com/console/linkedin). - -## Examples - -More examples are in the [examples folder](http://github.com/hexgnu/linkedin/blob/master/examples). +[View the Examples](EXAMPLES.md) ## Changelog diff --git a/examples/Authenticate.md b/examples/Authenticate.md deleted file mode 100644 index 91aaa4ab..00000000 --- a/examples/Authenticate.md +++ /dev/null @@ -1,32 +0,0 @@ -# Authenticate - -Here's an example of authenticating with the LinkedIn API - -```ruby -require 'rubygems' -require 'linkedin' - -# get your api keys at https://www.linkedin.com/secure/developer -client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') - -# If you want to use one of the scopes from linkedin you have to pass it in at this point -# You can learn more about it here: http://developer.linkedin.com/documents/authentication -request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") - -rtoken = request_token.token -rsecret = request_token.secret - -# to test from your desktop, open the following url in your browser -# and record the pin it gives you -request_token.authorize_url -=> "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" - -# then fetch your access keys -client.authorize_from_request(rtoken, rsecret, pin) -=> ["OU812", "8675309"] # <= save these for future requests - -# or authorize from previously fetched access keys -c.authorize_from_access("OU812", "8675309") - -# you're now free to move about the cabin, call any API method -``` diff --git a/examples/Communication.md b/examples/Communication.md deleted file mode 100644 index 64dd5c4a..00000000 --- a/examples/Communication.md +++ /dev/null @@ -1,13 +0,0 @@ -# Communication - -Here's an example of sending a message to two recipients - -```ruby -# AUTHENTICATE FIRST found in examples/authenticate.md - -# client is a LinkedIn::Client - -# send a message to a person in your network. you will need to authenticate the -# user and ask for the "w_messages" permission. -response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) -``` diff --git a/examples/Network.md b/examples/Network.md deleted file mode 100644 index 93a7947c..00000000 --- a/examples/Network.md +++ /dev/null @@ -1,19 +0,0 @@ -# Network - -Here are some examples of accessing network updates and connections of -the authenticated user - -``` ruby -# AUTHENTICATE FIRST found in examples/authenticate.rb - -# client is a LinkedIn::Client - -# get network updates for the authenticated user -client.network_updates - -# get profile picture changes -client.network_updates(:type => 'PICT') - -# view connections for the currently authenticated user -client.connections -``` diff --git a/examples/Profile.md b/examples/Profile.md deleted file mode 100644 index 50ae126a..00000000 --- a/examples/Profile.md +++ /dev/null @@ -1,26 +0,0 @@ -# Profile - -Here are some examples of accessing a user's profile - -```ruby -# AUTHENTICATE FIRST found in examples/authenticate.rb - -# client is a LinkedIn::Client - -# get the profile for the authenticated user -client.profile - -# get a profile for someone found in network via ID -client.profile(:id => 'gNma67_AdI') - -# get a profile for someone via their public profile url -client.profile(:url => 'http://www.linkedin.com/in/netherland') - -# provides the ability to access authenticated user's company field in the profile -user = client.profile(:fields => %w(positions)) -companies = user.positions.all.map{|t| t.company} -# Example: most recent company can be accessed via companies[0] - -# Example of a multi-email search against the special email search API -account_exists = client.profile(:email => 'email=yy@zz.com,email=xx@yy.com', :fields => ['id']) -``` diff --git a/examples/Sinatra.md b/examples/Sinatra.md deleted file mode 100644 index 6a3d9c18..00000000 --- a/examples/Sinatra.md +++ /dev/null @@ -1,84 +0,0 @@ -# Sinatra Example - -Here's an example sinatra application that performs authentication, -after which some info about the authenticated user can be retrieved. - -```ruby -require "rubygems" -require "haml" -require "sinatra" -require "linkedin" - -enable :sessions - -helpers do - def login? - !session[:atoken].nil? - end - - def profile - linkedin_client.profile unless session[:atoken].nil? - end - - def connections - linkedin_client.connections unless session[:atoken].nil? - end - - private - def linkedin_client - client = LinkedIn::Client.new(settings.api, settings.secret) - client.authorize_from_access(session[:atoken], session[:asecret]) - client - end - -end - -configure do - # get your api keys at https://www.linkedin.com/secure/developer - set :api, "your_api_key" - set :secret, "your_secret" -end - -get "/" do - haml :index -end - -get "/auth" do - client = LinkedIn::Client.new(settings.api, settings.secret) - request_token = client.request_token(:oauth_callback => "http://#{request.host}:#{request.port}/auth/callback") - session[:rtoken] = request_token.token - session[:rsecret] = request_token.secret - - redirect client.request_token.authorize_url -end - -get "/auth/logout" do - session[:atoken] = nil - redirect "/" -end - -get "/auth/callback" do - client = LinkedIn::Client.new(settings.api, settings.secret) - if session[:atoken].nil? - pin = params[:oauth_verifier] - atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin) - session[:atoken] = atoken - session[:asecret] = asecret - end - redirect "/" -end - - -__END__ -@@index --if login? - %p Welcome #{profile.first_name}! - %a{:href => "/auth/logout"} Logout - %p= profile.headline - %br - %div= "You have #{connections.total} connections!" - -connections.all.each do |c| - %div= "#{c.first_name} #{c.last_name} - #{c.headline}" --else - %a{:href => "/auth"} Login using LinkedIn -``` diff --git a/examples/UpdateStatus.md b/examples/UpdateStatus.md deleted file mode 100644 index b787616f..00000000 --- a/examples/UpdateStatus.md +++ /dev/null @@ -1,12 +0,0 @@ -# Update Status - -Here's an example of updating the current user's status - -```ruby -# AUTHENTICATE FIRST found in examples/authenticate.rb - -# client is a LinkedIn::Client - -# update status for the authenticated user -client.add_share(:comment => 'is playing with the LinkedIn Ruby gem') -``` From 7e4d9638b660a20c02bb4ec93277ddfbaaba1fdc Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 25 Jan 2014 10:45:55 -0500 Subject: [PATCH 075/117] CHANGELOG entry for documentation (#204) --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d1c9fc..2f76fda2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +* Document all methods +* Re-organize modules under Api to match organization in LinkedIn's REST + API documentation + ## 0.4.4 - Jan 11, 2014 * Group share add @@ -92,4 +96,4 @@ ## 0.0.1 - November 24, 2009 -* Initial release \ No newline at end of file +* Initial release From 056e4163f9c6ee1af42b2fbc61fedab0b1e6c436 Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 25 Jan 2014 10:48:08 -0500 Subject: [PATCH 076/117] Use link to rdoc.info under Documentation section of README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b6d36b5..015cf711 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)]( ## Documentation -Documented with yard. To view documentation locally, run: `yard server` +[http://rdoc.info/gems/linkedin](http://rdoc.info/gems/linkedin) ## Usage From df1226b8a811ef43f7e9b1975505b4e9d578075c Mon Sep 17 00:00:00 2001 From: Jason Nochlin Date: Sat, 25 Jan 2014 10:49:55 -0500 Subject: [PATCH 077/117] Correct description in README (gem no longer connects to XML API) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 015cf711..7c1e3388 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # LinkedIn -Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). The LinkedIn gem provides an easy-to-use wrapper for LinkedIn's Oauth/XML APIs. +Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). The LinkedIn gem provides an easy-to-use wrapper for LinkedIn's REST APIs. Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)](http://travis-ci.org/hexgnu/linkedin) From 83b50a720abe172ac5ebdc2a66e71aa42ed4a30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Baptiste=20B=C3=A9chu?= Date: Tue, 28 Jan 2014 00:32:14 +0100 Subject: [PATCH 078/117] Update EXAMPLES.md Variable name : c => client --- EXAMPLES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 1ed9bdc5..56cdc527 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -28,7 +28,7 @@ client.authorize_from_request(rtoken, rsecret, pin) => ["OU812", "8675309"] # <= save these for future requests # or authorize from previously fetched access keys -c.authorize_from_access("OU812", "8675309") +client.authorize_from_access("OU812", "8675309") # you're now free to move about the cabin, call any API method ``` From ff3aa0e36410d6439171314c8a4cdd42169b96c5 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Wed, 29 Jan 2014 09:32:40 -0800 Subject: [PATCH 079/117] Fixing jruby error by using kramdown and updating the README a bit --- README.md | 4 ++-- linkedin.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7c1e3388..8085b63a 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)]( ## Usage -[View the Examples](EXAMPLES.md) +[View the Examples](file.EXAMPLES.html) ## Changelog -[View the Changelog](CHANGELOG.md) +[View the Changelog](file.CHANGELOG.html) ## TODO diff --git a/linkedin.gemspec b/linkedin.gemspec index 394ab635..c8e57ffe 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |gem| # gem.add_development_dependency 'json', '~> 1.6' gem.add_development_dependency 'rake', '~> 10' gem.add_development_dependency 'yard' - gem.add_development_dependency 'redcarpet', '~> 2.0' + gem.add_development_dependency 'kramdown' gem.add_development_dependency 'rspec', '~> 2.13' gem.add_development_dependency 'simplecov', '~> 0.7' gem.add_development_dependency 'vcr', '~> 2.5' From 37b9e1d8f6571cd583e0c9879f97be3d7a7f68da Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Wed, 29 Jan 2014 10:01:54 -0800 Subject: [PATCH 080/117] Get rid of JRUBY 18 mode since we don't support 18 otherwise --- .travis.yml | 1 - spec/cases/api_spec.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b755342c..3677baad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,5 @@ rvm: - 2.0.0 - 2.1.0 - 1.9.3 - - jruby-18mode - jruby-19mode - rbx diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index e5240df3..7346ce2a 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -241,7 +241,7 @@ it "should be able to parse nested fields" do stub_request(:get, "https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,small-logo-url,short-description))").to_return(:body => "{}") - client.group_memberships(fields: [{group: ['id', 'name', 'small-logo-url', 'short-description']}]).should be_an_instance_of(LinkedIn::Mash) + client.group_memberships(:fields => [{:group => ['id', 'name', 'small-logo-url', 'short-description']}]).should be_an_instance_of(LinkedIn::Mash) end it "should be able to join a group" do From 8136bae55c90cbcc375ffbc2ee0deed933161ed9 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 21:25:19 +0000 Subject: [PATCH 081/117] Adding rubysl for travis --- Gemfile | 4 ++++ spec/helper.rb | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 1e01eae6..6e9fc5d4 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,8 @@ platforms :jruby do gem 'jruby-openssl', '~> 0.7' end +platforms :rbx do + gem 'rubysl' +end + gemspec diff --git a/spec/helper.rb b/spec/helper.rb index b1fa2e17..159e70b9 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -1,7 +1,10 @@ $:.unshift File.expand_path('..', __FILE__) $:.unshift File.expand_path('../../lib', __FILE__) -require 'simplecov' -SimpleCov.start +if ENV['COVERAGE'] == 't' + require 'simplecov' + SimpleCov.start +end + require 'linkedin' require 'rspec' require 'webmock/rspec' From 60912bccf99a7484f9f89631800c81b74cc48b69 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 21:47:41 +0000 Subject: [PATCH 082/117] Fixing rbx errors --- lib/linked_in/api/communications.rb | 2 +- lib/linked_in/api/companies.rb | 4 ++-- lib/linked_in/api/groups.rb | 4 ++-- lib/linked_in/api/jobs.rb | 2 +- lib/linked_in/api/share_and_social_stream.rb | 4 ++-- .../cassette_library/LinkedIn_Api/Company_API.yml | 2 +- .../_search/by_keywords_string_parameter.yml | 13 ++++++------- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/linked_in/api/communications.rb b/lib/linked_in/api/communications.rb index 8e67f692..b6ac9983 100644 --- a/lib/linked_in/api/communications.rb +++ b/lib/linked_in/api/communications.rb @@ -35,7 +35,7 @@ def send_message(subject, body, recipient_paths) end } } - post(path, message.to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(message), "Content-Type" => "application/json") end end diff --git a/lib/linked_in/api/companies.rb b/lib/linked_in/api/companies.rb index eec67e77..1110c100 100644 --- a/lib/linked_in/api/companies.rb +++ b/lib/linked_in/api/companies.rb @@ -98,7 +98,7 @@ def company_updates_likes(update_key, options={}) def add_company_share(company_id, share) path = "/companies/#{company_id}/shares" defaults = {:visibility => {:code => "anyone"}} - post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(defaults.merge(share)), "Content-Type" => "application/json") end # (Create) authenticated user starts following a company @@ -110,7 +110,7 @@ def add_company_share(company_id, share) def follow_company(company_id) path = "/people/~/following/companies" body = {:id => company_id } - post(path, body.to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(body), "Content-Type" => "application/json") end # (Destroy) authenticated user stops following a company diff --git a/lib/linked_in/api/groups.rb b/lib/linked_in/api/groups.rb index d0656ee4..3483bd84 100644 --- a/lib/linked_in/api/groups.rb +++ b/lib/linked_in/api/groups.rb @@ -96,7 +96,7 @@ def post_group_discussion(group_id, discussion) # @return [void] def add_group_share(group_id, share) path = "/groups/#{group_id}/posts" - post(path, share.to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(share), "Content-Type" => "application/json") end # (Update) User joins, or requests to join, a group @@ -108,7 +108,7 @@ def add_group_share(group_id, share) def join_group(group_id) path = "/people/~/group-memberships/#{group_id}" body = {'membership-state' => {'code' => 'member' }} - put(path, body.to_json, "Content-Type" => "application/json") + put(path, MultiJson.dump(body), "Content-Type" => "application/json") end end end diff --git a/lib/linked_in/api/jobs.rb b/lib/linked_in/api/jobs.rb index 50024193..3689bc28 100644 --- a/lib/linked_in/api/jobs.rb +++ b/lib/linked_in/api/jobs.rb @@ -57,7 +57,7 @@ def job_suggestions(options = {}) def add_job_bookmark(job_id) path = "/people/~/job-bookmarks" body = {'job' => {'id' => job_id}} - post(path, body.to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(body), "Content-Type" => "application/json") end end end diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb index 060fe2be..e9f2b4d9 100644 --- a/lib/linked_in/api/share_and_social_stream.rb +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -87,7 +87,7 @@ def share_likes(update_key, options={}) def add_share(share) path = "/people/~/shares" defaults = {:visibility => {:code => "anyone"}} - post(path, defaults.merge(share).to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(defaults.merge(share)), "Content-Type" => "application/json") end # Create a comment on an update from the authenticated user @@ -101,7 +101,7 @@ def add_share(share) def update_comment(update_key, comment) path = "/people/~/network/updates/key=#{update_key}/update-comments" body = {'comment' => comment} - post(path, body.to_json, "Content-Type" => "application/json") + post(path, MultiJson.dump(body), "Content-Type" => "application/json") end # (Update) like an update as the authenticated user diff --git a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml index 1128327f..991eb066 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml @@ -75,7 +75,7 @@ http_interactions: \"10001+\"\n },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\": {\n \"_total\": 1,\n \"values\": [{\n \"address\": {\n \"city\": \"Seattle\",\n \"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n - \ \"isHeadquarters\": true\n }]\n },\n \"name\": \"Amazon\"\n}" + \"isHeadquarters\": true\n }]\n },\n \"name\": \"Amazon\"\n}" http_version: '1.1' recorded_at: Wed, 10 Apr 2013 22:06:51 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml index 5180a0d1..bb15e11f 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml @@ -39,15 +39,14 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n - \ \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": - \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n - \ },\n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n - \ \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": + \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": + \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n}, + \n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n + \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n - \ \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": - \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n - \ }\n ]\n }\n}" + \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": + \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n}\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 From 4c92aacaf88c6171b202239123f1bd04eba62cda Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 22:01:32 +0000 Subject: [PATCH 083/117] More changes to the dumb linkedin fixtures --- .../_search_company/by_keywords_string_parameter.yml | 4 ++-- .../_search_company/by_single_keywords_option.yml | 4 ++-- .../by_single_keywords_option_with_facets_to_return.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index 2e7e4ace..e4b5e8dc 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -38,8 +38,8 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n - \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n - \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index ff4c8b41..866a2274 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -38,8 +38,8 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n - \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n - \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index 56b50f67..cbd6a117 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -38,8 +38,8 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n - \ \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n - \ \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": + \"_total\": 8450,\n \"values\": [\n {\n \"id\": 162479,\n + \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n From c4f419c8a54c8ca86def1edd869336d37daecf2f Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:05:55 -0800 Subject: [PATCH 084/117] Fixing json errors --- .../_search/by_company_name_option.yml | 8 ++-- .../by_first_name_and_last_name_options.yml | 12 ++--- ...name_and_last_name_options_with_fields.yml | 30 ++++++------ .../_search/by_single_keywords_option.yml | 6 +-- ...single_keywords_option_with_pagination.yml | 2 +- .../by_keywords_options_with_fields.yml | 46 +++++++++---------- .../by_keywords_string_parameter.yml | 12 ++--- .../by_single_keywords_option.yml | 12 ++--- ..._keywords_option_with_facets_to_return.yml | 6 +-- ...single_keywords_option_with_pagination.yml | 12 ++--- 10 files changed, 73 insertions(+), 73 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml index 45e14562..8ca65b94 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml @@ -79,13 +79,13 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Ryan\",\n \"id\": \"KHkgwBMaa-\",\n - \ \"lastName\": \"Sue\"\n },\n {\n \"firstName\": \"Ben\",\n - \ \"id\": \"lljISRB-WQ\",\n \"lastName\": \"Mejia\"\n },\n + \"lastName\": \"Sue\"\n },\n {\n \"firstName\": \"Ben\",\n + \"id\": \"lljISRB-WQ\",\n \"lastName\": \"Mejia\"\n },\n \ {\n \"firstName\": \"James\",\n \"id\": \"zLwxyfa2cv\",\n - \ \"lastName\": \"Stevenson\"\n },\n {\n \"firstName\": + \"lastName\": \"Stevenson\"\n },\n {\n \"firstName\": \"Charles\",\n \"id\": \"r5Kzi9Um-e\",\n \"lastName\": \"Kafoglis\"\n \ },\n {\n \"firstName\": \"Sauraj\",\n \"id\": \"RLJu6NhdI2\",\n - \ \"lastName\": \"Goswami\"\n },\n {\n \"firstName\": + \"lastName\": \"Goswami\"\n },\n {\n \"firstName\": \"Jonathan\",\n \"id\": \"NgAxaSCyZ3\",\n \"lastName\": \"Hedstrom\"\n \ }\n ]\n }\n}" http_version: '1.1' diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml index 8baf1929..fddcdb43 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml @@ -78,21 +78,21 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n - \ \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": + \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, CFA\"\n },\n {\n \"firstName\": \"Charles R.\",\n \"id\": \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\"\n },\n {\n - \ \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n \"lastName\": + \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n \"lastName\": \"Garcia-Tobin\"\n },\n {\n \"firstName\": \"Charles\",\n - \ \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\"\n },\n + \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\"\n },\n \ {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n - \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n \"lastName\": \"Garcia\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n - \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n \"lastName\": \"Garcia\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n - \ \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": + \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": \"Charles\",\n \"id\": \"koTmAyWE8J\",\n \"lastName\": \"Schwalbe Garcia-Lago\"\n }\n ]\n }\n}" http_version: '1.1' diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml index 54ddedd6..667ae7ea 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml @@ -78,34 +78,34 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n - \ \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": + \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, CFA\",\n \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesgarcia\"\n \ },\n {\n \"firstName\": \"Charles R.\",\n \"id\": \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KukV6r4QDft-oYwsKfzsXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWUUfdKb\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/in/knightwealthmanagement\"\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/knightwealthmanagement\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n - \ \"lastName\": \"Garcia-Tobin\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37\"\n + \"lastName\": \"Garcia-Tobin\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"jYfrk5GM29\",\n - \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/in/charleshgarcia\"\n + \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/charleshgarcia\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n - \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/26/1b2/b28\"\n + \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/26/1b2/b28\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n - \ \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/5/465/b00\"\n + \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/5/465/b00\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n - \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/8/152/3ab\"\n + \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/8/152/3ab\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n - \ \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/in/chasgarcia\"\n + \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/chasgarcia\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n - \ \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/14/6a7/81\"\n + \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/14/6a7/81\"\n \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"koTmAyWE8J\",\n - \ \"lastName\": \"Schwalbe Garcia-Lago\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb\",\n - \ \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesschwalbe\"\n + \"lastName\": \"Schwalbe Garcia-Lago\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesschwalbe\"\n \ }\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml index 58a00593..51d435f5 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml @@ -39,13 +39,13 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n - \ \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": + \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n \ },\n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n - \ \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": + \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n - \ \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": + \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n \ }\n ]\n }\n}" http_version: '1.1' diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml index cec486ed..c8ba99ce 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml @@ -39,7 +39,7 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_count\": 1,\n \"_start\": 5,\n \"_total\": 6,\n \"values\": [{\n \"firstName\": \"Satish\",\n - \ \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n }]\n }\n}" + \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n }]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index 0f3c40fa..8a0ca3d1 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -38,7 +38,7 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n - \ \"_total\": 8450,\n \"values\": [\n {\n \"description\": + \"_total\": 8450,\n \"values\": [\n {\n \"description\": \"Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the @@ -49,8 +49,8 @@ http_interactions: \ }]\n },\n \"name\": \"Apple\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Innovative product development\",\n \"world class operations\",\n \"Retail\",\n - \ \"Telephone Support\"\n ]\n }\n },\n {\n - \ \"description\": \"Experience the Difference. \\r\\nFor over + \"Telephone Support\"\n ]\n }\n },\n {\n + \"description\": \"Experience the Difference. \\r\\nFor over 40 years, Apple Vacations has provided the most value in vacations to millions of people. Throughout the years, we\\u2019ve provided what you want in a vacation \\u2013 great service, convenience, and value. We understand just how important @@ -69,8 +69,8 @@ http_interactions: in-resort with uniformed representatives, who will greet you upon arrival and assist you while you are at your resort. Unlike any other travel company, Apple Vacations truly provides the ultimate in a quality vacation experience.\",\n - \ \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n - \ \"values\": [{\n \"code\": \"30\",\n \"name\": + \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n + \"values\": [{\n \"code\": \"30\",\n \"name\": \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n @@ -84,7 +84,7 @@ http_interactions: in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n - \ \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n + \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n \ },\n {\n \"description\": \"Apple & Associates is an executive search firm that specializes in the Pharmaceutical, Medical Device and Consumer Product Industries. We provide extensive coverage of these worldwide markets @@ -99,24 +99,24 @@ http_interactions: recruiting firms. Because our executive recruiters specialize in different industry segments, we can give you the service you deserve in a fast, focused, and efficient manner and provide you with quality industry specific candidates. - \ \\r\\n\\r\\nWe realize the importance of hiring professionals who understand + \\r\\n\\r\\nWe realize the importance of hiring professionals who understand and are able to assimilate with your company\\u2019s business model, culture, process, equipment, and materials. Our team has studied the hiring decisions that make the firms in the Pharmaceutical and Medical Device industries so successful. Our candidates will meet the standard your company demands, with the technical and industry background to match.\",\n \"id\": 112136,\n - \ \"industries\": {\n \"_total\": 1,\n \"values\": + \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": {\n \"_total\": 20,\n \"values\": [\n \"Medical Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n - \ \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n - \ \"Engineering\",\n \"Marketing\",\n \"Sales\",\n - \ \"Human Resources\",\n \"Science\",\n \"Finance\",\n - \ \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n - \ \"Six Sigma\",\n \"IT\",\n \"chemist\",\n - \ \"Executive Management\"\n ]\n }\n },\n {\n - \ \"description\": \"Headquartered in Singapore and a presence in 9 + \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n + \"Engineering\",\n \"Marketing\",\n \"Sales\",\n + \"Human Resources\",\n \"Science\",\n \"Finance\",\n + \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n + \"Six Sigma\",\n \"IT\",\n \"chemist\",\n + \"Executive Management\"\n ]\n }\n },\n {\n + \"description\": \"Headquartered in Singapore and a presence in 9 countries globally, Stone Apple is a Specialized Consulting firm focused mainly on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge Management & Application Integration with a strong product portfolio, analytical @@ -128,7 +128,7 @@ http_interactions: to meet the changing needs of enterprises globally. From leading industry methodologies to in-house proven models, Stone Apple collaborates with their customers to deliver tangible business results that impact their bottom line.\",\n - \ \"id\": 772044,\n \"industries\": {\n \"_total\": + \"id\": 772044,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": \"Information Technology & Services\"\n }]\n },\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"description\": \"iSquare @@ -155,7 +155,7 @@ http_interactions: the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n - \ \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n + \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n \ },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i Servis) je autorizirani Apple partner za prodaju, servis i podrÅ¡ku.\\r\\n\\r\\nFilex je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapreÄ\x91ujemo @@ -171,10 +171,10 @@ http_interactions: zadovoljstvo naÅ¡a je misija!\",\n \"id\": 2303504,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n - \ \"name\": \"Filex Apple Store & Support\",\n \"specialties\": + \"name\": \"Filex Apple Store & Support\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"Apple Store\",\n \"Apple PodrÅ¡ka i Servis\",\n \"Apple RjeÅ¡enja\",\n - \ \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": + \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over @@ -184,12 +184,12 @@ http_interactions: doen we met veel liefde voor de verschillende producten en voor Apple in het algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n - \ \"industries\": {\n \"_total\": 1,\n \"values\": + \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n \ }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n - \ \"specialties\": {\n \"_total\": 4,\n \"values\": + \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n - \ \"mac\"\n ]\n }\n },\n {\n \"description\": + \"mac\"\n ]\n }\n },\n {\n \"description\": \"OGGO est une société de conseils et solutions Apple Macintosh basée à Genève, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos services en un coup d'oeil :\\r\\n\\r\\n// Réparations\\r\\n// Optimisations @@ -200,7 +200,7 @@ http_interactions: \"Information Technology & Services\"\n }]\n },\n \"name\": \"OGGO - Services Apple Macintosh\",\n \"specialties\": {\n \"_total\": 7,\n \"values\": [\n \"Consulting & conseils Apple Macintosh\",\n - \ \"Support Apple Macintosh\",\n \"Maintenance Mac OS + \"Support Apple Macintosh\",\n \"Maintenance Mac OS X Server\",\n \"Dépannage Mac OS X\",\n \"Installation Mac OS X Server\",\n \"Interventions Apple Macintosh\",\n \"Formation Apple Macintosh\"\n ]\n }\n },\n {\n \"description\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index e4b5e8dc..9fe7d92c 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -49,20 +49,20 @@ http_interactions: \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n - \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n - \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco Bay Area\",\n \"selected\": false\n },\n {\n - \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n - \ \"name\": \"Netherlands\",\n \"selected\": false\n + \"name\": \"Netherlands\",\n \"selected\": false\n \ },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n \ },\n {\n \"code\": \"au:0\",\n \"count\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index 866a2274..b119d4ec 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -49,20 +49,20 @@ http_interactions: \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n - \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n - \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco Bay Area\",\n \"selected\": false\n },\n {\n - \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n - \ \"name\": \"Netherlands\",\n \"selected\": false\n + \"name\": \"Netherlands\",\n \"selected\": false\n \ },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n \ },\n {\n \"code\": \"au:0\",\n \"count\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index cbd6a117..db271191 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -49,14 +49,14 @@ http_interactions: \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n - \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n - \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"96\",\n \"count\": 2062,\n \"name\": \"Information Technology and Services\",\n \"selected\": false\n },\n \ {\n \"code\": \"4\",\n \"count\": 1031,\n - \ \"name\": \"Computer Software\",\n \"selected\": false\n + \"name\": \"Computer Software\",\n \"selected\": false\n \ },\n {\n \"code\": \"6\",\n \"count\": 472,\n \"name\": \"Internet\",\n \"selected\": false\n \ },\n {\n \"code\": \"3\",\n \"count\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index d5ef708e..97a2924e 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -43,20 +43,20 @@ http_interactions: \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n - \ \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n - \ \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n + \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n + \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n - \ \"selected\": false\n },\n {\n \"code\": + \"selected\": false\n },\n {\n \"code\": \"us:84\",\n \"count\": 322,\n \"name\": \"San Francisco Bay Area\",\n \"selected\": false\n },\n {\n - \ \"code\": \"us:70\",\n \"count\": 285,\n \"name\": + \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n - \ \"name\": \"Netherlands\",\n \"selected\": false\n + \"name\": \"Netherlands\",\n \"selected\": false\n \ },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n \ },\n {\n \"code\": \"au:0\",\n \"count\": From 589bf64083037cb87c07c935323dbc4569c80106 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:10:43 -0800 Subject: [PATCH 085/117] Folding in the \ns --- .../LinkedIn_Api/Company_API.yml | 4 ++-- .../by_keywords_options_with_fields.yml | 24 +++++++++---------- .../by_keywords_string_parameter.yml | 4 ++-- .../by_single_keywords_option.yml | 4 ++-- ..._keywords_option_with_facets_to_return.yml | 4 ++-- ...single_keywords_option_with_pagination.yml | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml index 991eb066..5e231240 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml @@ -72,8 +72,8 @@ http_interactions: body: encoding: UTF-8 string: ! "{\n \"employeeCountRange\": {\n \"code\": \"I\",\n \"name\": - \"10001+\"\n },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\": - {\n \"_total\": 1,\n \"values\": [{\n \"address\": {\n \"city\": + \"10001+\"\n },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\":{\n + \"_total\": 1,\n \"values\": [{\n \"address\": {\n \"city\": \"Seattle\",\n \"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n \"isHeadquarters\": true\n }]\n },\n \"name\": \"Amazon\"\n}" http_version: '1.1' diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index 8a0ca3d1..ebaa2997 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -46,8 +46,8 @@ http_interactions: the future of mobile media and computing devices with iPad.\",\n \"id\": 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n - \ }]\n },\n \"name\": \"Apple\",\n \"specialties\": - {\n \"_total\": 4,\n \"values\": [\n \"Innovative + \ }]\n },\n \"name\": \"Apple\",\n \"specialties\":{\n + \"_total\": 4,\n \"values\": [\n \"Innovative product development\",\n \"world class operations\",\n \"Retail\",\n \"Telephone Support\"\n ]\n }\n },\n {\n \"description\": \"Experience the Difference. \\r\\nFor over @@ -81,8 +81,8 @@ http_interactions: and to fill the growing need for property management services in Central Florida, we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease Only\\\" services at competitive prices, we currently manage close to 50 properties - in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": + in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\":{\n + \"_total\": 1,\n \"values\": [{\n \"code\": \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n \ },\n {\n \"description\": \"Apple & Associates is an executive @@ -107,8 +107,8 @@ http_interactions: the technical and industry background to match.\",\n \"id\": 112136,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n - \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\": - {\n \"_total\": 20,\n \"values\": [\n \"Medical + \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\":{\n + \"_total\": 20,\n \"values\": [\n \"Medical Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n \"Engineering\",\n \"Marketing\",\n \"Sales\",\n @@ -152,8 +152,8 @@ http_interactions: Apple's ecosystem as the distributor of software and peripherals from well known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, iSquare aspires to bring the Apple products at the stature they deserve within - the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": + the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\":{\n + \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n \ },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i @@ -168,11 +168,11 @@ http_interactions: izaÄ\x87i sa rjeÅ¡enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte nas preko naÅ¡eg Internet Store-a (www.filex.hr), ili nam piÅ¡ite na prodaja@filx.hr ili servis@filex.hr.\\r\\nI svakako nam se pridružite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-DuÄ\x87an-i-Servis/131194173598671\\r\\n\\r\\nVaÅ¡e - zadovoljstvo naÅ¡a je misija!\",\n \"id\": 2303504,\n \"industries\": - {\n \"_total\": 1,\n \"values\": [{\n \"code\": + zadovoljstvo naÅ¡a je misija!\",\n \"id\": 2303504,\n \"industries\":{\n + \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n - \"name\": \"Filex Apple Store & Support\",\n \"specialties\": - {\n \"_total\": 4,\n \"values\": [\n \"Apple + \"name\": \"Filex Apple Store & Support\",\n \"specialties\":{\n + \"_total\": 4,\n \"values\": [\n \"Apple Store\",\n \"Apple PodrÅ¡ka i Servis\",\n \"Apple RjeÅ¡enja\",\n \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index 9fe7d92c..89fd7a89 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -51,8 +51,8 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": - {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index b119d4ec..7ffb6a88 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -51,8 +51,8 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": - {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index db271191..cbd204f6 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -51,8 +51,8 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": - {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + \"_total\": 10,\n \"values\": [\n {\n \"code\": \"96\",\n \"count\": 2062,\n \"name\": \"Information Technology and Services\",\n \"selected\": false\n },\n \ {\n \"code\": \"4\",\n \"count\": 1031,\n diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index 97a2924e..5751aec6 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -45,8 +45,8 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\": - {\n \"_total\": 10,\n \"values\": [\n {\n \"code\": + \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": \"gb:0\",\n \"count\": 702,\n \"name\": \"United Kingdom\",\n From 900abc532cf880cb9f05f4179d7b109f17d73c41 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:16:28 -0800 Subject: [PATCH 086/117] Little tweaks --- .../_search/by_company_name_option.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml index 8ca65b94..2f90f12f 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml @@ -80,14 +80,13 @@ http_interactions: string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Ryan\",\n \"id\": \"KHkgwBMaa-\",\n \"lastName\": \"Sue\"\n },\n {\n \"firstName\": \"Ben\",\n - \"id\": \"lljISRB-WQ\",\n \"lastName\": \"Mejia\"\n },\n - \ {\n \"firstName\": \"James\",\n \"id\": \"zLwxyfa2cv\",\n + \"id\": \"lljISRB-WQ\",\n \"lastName\": \"Mejia\"\n },\n{\n + \"firstName\": \"James\",\n \"id\": \"zLwxyfa2cv\",\n \"lastName\": \"Stevenson\"\n },\n {\n \"firstName\": - \"Charles\",\n \"id\": \"r5Kzi9Um-e\",\n \"lastName\": \"Kafoglis\"\n - \ },\n {\n \"firstName\": \"Sauraj\",\n \"id\": \"RLJu6NhdI2\",\n + \"Charles\",\n \"id\": \"r5Kzi9Um-e\",\n \"lastName\": \"Kafoglis\"\n},\n{\n + \"firstName\": \"Sauraj\",\n \"id\": \"RLJu6NhdI2\",\n \"lastName\": \"Goswami\"\n },\n {\n \"firstName\": - \"Jonathan\",\n \"id\": \"NgAxaSCyZ3\",\n \"lastName\": \"Hedstrom\"\n - \ }\n ]\n }\n}" + \"Jonathan\",\n \"id\": \"NgAxaSCyZ3\",\n \"lastName\": \"Hedstrom\"\n }\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 From 49cabe83c2c0927dc81b3f4fe36e0e5f6196db62 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:19:53 -0800 Subject: [PATCH 087/117] Fixing up errors --- .../by_first_name_and_last_name_options.yml | 20 +++++++++---------- .../_search/by_keywords_string_parameter.yml | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml index fddcdb43..ffa35906 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml @@ -79,22 +79,22 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": - \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, - CFA\"\n },\n {\n \"firstName\": \"Charles R.\",\n \"id\": + \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, CFA\"\n},\n{\n + \"firstName\": \"Charles R.\",\n \"id\": \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\"\n },\n {\n \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n \"lastName\": \"Garcia-Tobin\"\n },\n {\n \"firstName\": \"Charles\",\n - \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\"\n },\n - \ {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n + \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\"\n },\n{\n + \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": - \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n \"lastName\": \"Garcia\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n + \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n \"lastName\": \"Garcia\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": - \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n \"lastName\": \"Garcia\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n + \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n \"lastName\": \"Garcia\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n \"lastName\": \"Garcia\"\n },\n {\n \"firstName\": - \"Charles\",\n \"id\": \"koTmAyWE8J\",\n \"lastName\": \"Schwalbe - Garcia-Lago\"\n }\n ]\n }\n}" + \"Charles\",\n \"id\": \"koTmAyWE8J\",\n \"lastName\": + \"Schwalbe Garcia-Lago\"\n }\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml index bb15e11f..ef3f4aca 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml @@ -40,11 +40,11 @@ http_interactions: string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": - \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n}, - \n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n + \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n},\n {\n + \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": - \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n - \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n + \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n},\n {\n + \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n}\n ]\n }\n}" http_version: '1.1' From 3d63a95db85de2e27cb468e0fb065e9791962c39 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:23:17 -0800 Subject: [PATCH 088/117] Ugh this is getting old --- ...name_and_last_name_options_with_fields.yml | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml index 667ae7ea..9fce73ec 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml @@ -79,34 +79,36 @@ http_interactions: encoding: UTF-8 string: ! "{\n \"numResults\": 308,\n \"people\": {\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 110,\n \"values\": [\n {\n \"firstName\": - \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, - CFA\",\n \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesgarcia\"\n - \ },\n {\n \"firstName\": \"Charles R.\",\n \"id\": + \"Charles\",\n \"id\": \"2zk34r8TvA\",\n \"lastName\": \"Garcia, CFA\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesgarcia\"\n},\n {\n + \"firstName\": \"Charles R.\",\n \"id\": \"NjwO1vU6P6\",\n \"lastName\": \"Garcia Jr.\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KukV6r4QDft-oYwsKfzsXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWUUfdKb\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/in/knightwealthmanagement\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n - \"lastName\": \"Garcia-Tobin\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"jYfrk5GM29\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/knightwealthmanagement\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"j8ZczJo44W\",\n + \"lastName\": \"Garcia-Tobin\",\n \"publicProfileUrl\": + \"http://www.linkedin.com/pub/charles-garcia-tobin/1/407/37\"\n },\n {\n + \"firstName\": \"Charles\",\n \"id\": \"jYfrk5GM29\",\n \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_oCf8Sdu0zOpQN_tEeLaPSwVjvZHIq5CEH6R0SEw2EOpRI3voQk0uio0GUveqBC_QITDYCDz2KP6m\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/in/charleshgarcia\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/charleshgarcia\"\n },\n {\n + \"firstName\": \"Charles\",\n \"id\": \"C-2ASm3SQ1\",\n \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_eyd5KuNsktdHTE1-6RasKacFXqyWSdi-oUjVKaLVRAeMtSqtXsJWOmlqospnaaGOWxIUxWRzo_ib\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/26/1b2/b28\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n - \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/5/465/b00\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/26/1b2/b28\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"LG__MFCUTJ\",\n + \"lastName\": \"Garcia\",\n \"publicProfileUrl\": + \"http://www.linkedin.com/pub/charles-garcia/5/465/b00\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"wjopxKqYYM\",\n \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_ePvupanfrtgopBCiEBzPpuFir-Zdp-tioNT1pSkPfNuJin5_Xv58tDrgO049xzPfWKBt1o9wYUsb\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/8/152/3ab\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/8/152/3ab\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"AtFQt5Lf1V\",\n \"lastName\": \"Garcia\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_uuv-7sRI0s_EdtBWuecS7Jf9jM5owt6WaSTS7Jd9GylVN9AdhE5O3Mg41cLzHvF5S7B28YBarPYq\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/in/chasgarcia\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n - \"lastName\": \"Garcia\",\n \"publicProfileUrl\": \"http://www.linkedin.com/pub/charles-garcia/14/6a7/81\"\n - \ },\n {\n \"firstName\": \"Charles\",\n \"id\": \"koTmAyWE8J\",\n + \"publicProfileUrl\": \"http://www.linkedin.com/in/chasgarcia\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"MUXIZwfehE\",\n + \"lastName\": \"Garcia\",\n \"publicProfileUrl\": + \"http://www.linkedin.com/pub/charles-garcia/14/6a7/81\"\n},\n {\n + \"firstName\": \"Charles\",\n \"id\": \"koTmAyWE8J\",\n \"lastName\": \"Schwalbe Garcia-Lago\",\n \"pictureUrl\": \"http://m3.licdn.com/mpr/mprx/0_q6hJ9GyYDCe0NRJ1sGCQ9TSySTY-nZZ1nFqQ9TyatkEGWp7PZhrzZ3Hh_fODzxM0zLGFJ6CC9gBb\",\n - \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesschwalbe\"\n - \ }\n ]\n }\n}" + \"publicProfileUrl\": \"http://www.linkedin.com/in/charlesschwalbe\"\n }\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 From de9efefee4a3ae666e5a56051ffdafb6df116767 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:26:55 -0800 Subject: [PATCH 089/117] More fixes to spec fixtures --- .../_search/by_single_keywords_option.yml | 11 +++++------ .../by_single_keywords_option_with_pagination.yml | 4 +--- .../_search/email_search_returns_unauthorized.yml | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml index 51d435f5..91ce91d3 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml @@ -40,14 +40,13 @@ http_interactions: string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_total\": 6,\n \"values\": [\n {\n \"firstName\": \"Shay\",\n \"id\": \"ucXjUw4M9J\",\n \"lastName\": \"Frendt\"\n },\n {\n \"firstName\": - \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n - \ },\n {\n \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n + \"Scott\",\n \"id\": \"t6mvVsY3df\",\n \"lastName\": \"Smith\"\n },\n {\n + \"firstName\": \"Philip\",\n \"id\": \"ZeSnXwtz6Y\",\n \"lastName\": \"Corliss\"\n },\n {\n \"firstName\": - \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n - \ },\n {\n \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n + \"Jay\",\n \"id\": \"i24wDA2GrH\",\n \"lastName\": \"Beavers\"\n},\n {\n + \"firstName\": \"Chris\",\n \"id\": \"SJBelisgHh\",\n \"lastName\": \"Wiswell\"\n },\n {\n \"firstName\": - \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n - \ }\n ]\n }\n}" + \"Satish\",\n \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n}\n ]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml index c8ba99ce..88203d42 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml @@ -37,9 +37,7 @@ http_interactions: - chunked body: encoding: UTF-8 - string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_count\": 1,\n \"_start\": - 5,\n \"_total\": 6,\n \"values\": [{\n \"firstName\": \"Satish\",\n - \"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n }]\n }\n}" + string: ! "{\n \"numResults\": 6,\n \"people\": {\n \"_count\": 1,\n \"_start\":5,\n \"_total\": 6,\n \"values\": [{\n \"firstName\": \"Satish\",\n\"id\": \"V1FPuGot-I\",\n \"lastName\": \"Talim\"\n }]\n }\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml index da83ecd6..3e773ad6 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml @@ -59,5 +59,5 @@ http_interactions: "status": 403, "timestamp": 1389727130475 } - http_version: + http_version: recorded_at: Tue, 14 Jan 2014 16:21:01 GMT \ No newline at end of file From bb6bd87bee448ee294ecfc739f39eda24ec67640 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:32:17 -0800 Subject: [PATCH 090/117] Fixing rest of JSON errors --- .../_search/by_email_address.yml | 12 +++--------- .../_search/by_multiple_email_address.yml | 17 ++++------------- .../email_search_returns_unauthorized.yml | 12 ++++-------- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml index 4a481a48..50e34793 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml @@ -51,13 +51,7 @@ http_interactions: 13 Jan 2014 22:01:44 GMT; domain=.linkedin.com; Path=/ body: encoding: UTF-8 - string: |- - { - "_total": 1, - "values": [{ - "_key": "email=yy@zz.com", - "id": "96GVfLeWjU" - }] - } - http_version: + string: ! "{\"_total\": 1,\"values\": [{ + \"_key\": \"email=yy@zz.com\",\"id\": \"96GVfLeWjU\"}]}" + http_version: recorded_at: Mon, 13 Jan 2014 21:51:44 GMT \ No newline at end of file diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml index 36350f11..5d39d569 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml @@ -52,17 +52,8 @@ http_interactions: 13 Jan 2014 21:43:51 GMT; domain=.linkedin.com; Path=/ body: encoding: UTF-8 - string: |- - { - "_total": 2, - "values": [{ - "_key": "email=yy@zz.com", - "id": "96GVfLeWjU" - }, - { - "_key": "email=xx@yy.com", - "id": "10CGfLfLhI" - }] - } - http_version: + string: ! "{\"_total\": 2,\"values\": [{ + \"_key\": \"email=yy@zz.com\",\"id\": \"96GVfLeWjU\"},{ + \"_key\": \"email=xx@yy.com\",\"id\": \"10CGfLfLhI\"}]}" + http_version: recorded_at: Mon, 13 Jan 2014 21:33:51 GMT \ No newline at end of file diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml index 3e773ad6..2c250b4b 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml @@ -51,13 +51,9 @@ http_interactions: 14 Jan 2014 16:30:58 GMT; domain=.linkedin.com; Path=/ body: encoding: UTF-8 - string: |- - { - "errorCode": 0, - "message": "Access to member by email address denied", - "requestId": "BRSUSQTPPW", - "status": 403, - "timestamp": 1389727130475 - } + string: ! "{\"errorCode\": 0,\"message\": \"Access to member by email address denied\", + \"requestId\": \"BRSUSQTPPW\", + \"status\": 403, + \"timestamp\": 1389727130475}" http_version: recorded_at: Tue, 14 Jan 2014 16:21:01 GMT \ No newline at end of file From a022f850d8febc1f91886bc462becdd3e6765924 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:35:22 -0800 Subject: [PATCH 091/117] More fixes to fixtures --- .../by_keywords_options_with_fields.yml | 16 ++++++++-------- .../by_keywords_string_parameter.yml | 18 +++++++++--------- .../by_single_keywords_option.yml | 18 +++++++++--------- ...e_keywords_option_with_facets_to_return.yml | 14 +++++++------- ..._single_keywords_option_with_pagination.yml | 14 +++++++------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index ebaa2997..7927c83f 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -46,7 +46,7 @@ http_interactions: the future of mobile media and computing devices with iPad.\",\n \"id\": 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n - \ }]\n },\n \"name\": \"Apple\",\n \"specialties\":{\n + }]\n },\n \"name\": \"Apple\",\n \"specialties\":{\n \"_total\": 4,\n \"values\": [\n \"Innovative product development\",\n \"world class operations\",\n \"Retail\",\n \"Telephone Support\"\n ]\n }\n },\n {\n @@ -74,7 +74,7 @@ http_interactions: \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n - \ ]\n }\n },\n {\n \"description\": \"Big + ]\n }\n },\n {\n \"description\": \"Big Apple International Realty has been listing, selling and managing Residential Real Estate in four counties of the Greater Orlando and Central Florida areas for over five years. Because our Property Management Division had grown substantially, @@ -85,7 +85,7 @@ http_interactions: \"_total\": 1,\n \"values\": [{\n \"code\": \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n - \ },\n {\n \"description\": \"Apple & Associates is an executive + },\n {\n \"description\": \"Apple & Associates is an executive search firm that specializes in the Pharmaceutical, Medical Device and Consumer Product Industries. We provide extensive coverage of these worldwide markets and have forged a solid reputation in the industry as a competent, aggressive, @@ -107,7 +107,7 @@ http_interactions: the technical and industry background to match.\",\n \"id\": 112136,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n - \ }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\":{\n + }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\":{\n \"_total\": 20,\n \"values\": [\n \"Medical Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n @@ -156,7 +156,7 @@ http_interactions: \"_total\": 1,\n \"values\": [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n - \ },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i + },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i Servis) je autorizirani Apple partner za prodaju, servis i podrÅ¡ku.\\r\\n\\r\\nFilex je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapreÄ\x91ujemo prepoznatljivost Apple tehnologija prezentirajuÄ\x87i upotrebnu vrijednost @@ -186,7 +186,7 @@ http_interactions: voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n - \ }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n + }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n \"specialties\": {\n \"_total\": 4,\n \"values\": [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n \"mac\"\n ]\n }\n },\n {\n \"description\": @@ -225,8 +225,8 @@ http_interactions: that we cannot provide a solution, wherever you may be!\",\n \"id\": 1049054,\n \"industries\": {\n \"_total\": 1,\n \"values\": [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n - \ }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"numResults\": 8450\n}" + }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n + },\n \"numResults\": 8450\n}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index 89fd7a89..9d26ad1d 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -42,11 +42,11 @@ http_interactions: \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n - \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n - \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n @@ -61,17 +61,17 @@ http_interactions: Bay Area\",\n \"selected\": false\n },\n {\n \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n - \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + {\n \"code\": \"nl:0\",\n \"count\": 284,\n \"name\": \"Netherlands\",\n \"selected\": false\n - \ },\n {\n \"code\": \"ca:0\",\n \"count\": + },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n - \ },\n {\n \"code\": \"au:0\",\n \"count\": + },\n {\n \"code\": \"au:0\",\n \"count\": 195,\n \"name\": \"Australia\",\n \"selected\": false\n - \ },\n {\n \"code\": \"in:0\",\n \"count\": + },\n {\n \"code\": \"in:0\",\n \"count\": 186,\n \"name\": \"India\",\n \"selected\": false\n - \ },\n {\n \"code\": \"it:0\",\n \"count\": + },\n {\n \"code\": \"it:0\",\n \"count\": 177,\n \"name\": \"Italy\",\n \"selected\": false\n - \ },\n {\n \"code\": \"us:49\",\n \"count\": + },\n {\n \"code\": \"us:49\",\n \"count\": 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n }]\n },\n \"numResults\": 8450\n}" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index 7ffb6a88..d7d4b5ae 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -42,11 +42,11 @@ http_interactions: \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n - \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n - \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n @@ -61,17 +61,17 @@ http_interactions: Bay Area\",\n \"selected\": false\n },\n {\n \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n - \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + {\n \"code\": \"nl:0\",\n \"count\": 284,\n \"name\": \"Netherlands\",\n \"selected\": false\n - \ },\n {\n \"code\": \"ca:0\",\n \"count\": + },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n - \ },\n {\n \"code\": \"au:0\",\n \"count\": + },\n {\n \"code\": \"au:0\",\n \"count\": 195,\n \"name\": \"Australia\",\n \"selected\": false\n - \ },\n {\n \"code\": \"in:0\",\n \"count\": + },\n {\n \"code\": \"in:0\",\n \"count\": 186,\n \"name\": \"India\",\n \"selected\": false\n - \ },\n {\n \"code\": \"it:0\",\n \"count\": + },\n {\n \"code\": \"it:0\",\n \"count\": 177,\n \"name\": \"Italy\",\n \"selected\": false\n - \ },\n {\n \"code\": \"us:49\",\n \"count\": + },\n {\n \"code\": \"us:49\",\n \"count\": 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n }]\n },\n \"numResults\": 8450\n}" diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index cbd204f6..b790a701 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -42,11 +42,11 @@ http_interactions: \"name\": \"Apple\"\n },\n {\n \"id\": 19271,\n \"name\": \"Apple Vacations\"\n },\n {\n \"id\": 778626,\n \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n },\n - \ {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n - \ },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple + {\n \"id\": 112136,\n \"name\": \"Apple & Associates\"\n + },\n {\n \"id\": 772044,\n \"name\": \"Stone Apple Solutions\"\n },\n {\n \"id\": 2135525,\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n - \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n @@ -55,11 +55,11 @@ http_interactions: \"_total\": 10,\n \"values\": [\n {\n \"code\": \"96\",\n \"count\": 2062,\n \"name\": \"Information Technology and Services\",\n \"selected\": false\n },\n - \ {\n \"code\": \"4\",\n \"count\": 1031,\n + {\n \"code\": \"4\",\n \"count\": 1031,\n \"name\": \"Computer Software\",\n \"selected\": false\n - \ },\n {\n \"code\": \"6\",\n \"count\": + },\n {\n \"code\": \"6\",\n \"count\": 472,\n \"name\": \"Internet\",\n \"selected\": false\n - \ },\n {\n \"code\": \"3\",\n \"count\": + },\n {\n \"code\": \"3\",\n \"count\": 415,\n \"name\": \"Computer Hardware\",\n \"selected\": false\n },\n {\n \"code\": \"80\",\n \"count\": 348,\n \"name\": \"Marketing and Advertising\",\n \"selected\": @@ -67,7 +67,7 @@ http_interactions: 312,\n \"name\": \"Consumer Electronics\",\n \"selected\": false\n },\n {\n \"code\": \"27\",\n \"count\": 206,\n \"name\": \"Retail\",\n \"selected\": false\n - \ },\n {\n \"code\": \"109\",\n \"count\": + },\n {\n \"code\": \"109\",\n \"count\": 185,\n \"name\": \"Computer Games\",\n \"selected\": false\n },\n {\n \"code\": \"8\",\n \"count\": 171,\n \"name\": \"Telecommunications\",\n \"selected\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index 5751aec6..7d804562 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -40,7 +40,7 @@ http_interactions: string: ! "{\n \"companies\": {\n \"_count\": 5,\n \"_start\": 5,\n \"_total\": 8450,\n \"values\": [\n {\n \"id\": 2135525,\n \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n },\n - \ {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & + {\n \"id\": 2303504,\n \"name\": \"Filex Apple Store & Support\"\n },\n {\n \"id\": 2419290,\n \"name\": \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n @@ -55,17 +55,17 @@ http_interactions: Bay Area\",\n \"selected\": false\n },\n {\n \"code\": \"us:70\",\n \"count\": 285,\n \"name\": \"Greater New York City Area\",\n \"selected\": false\n },\n - \ {\n \"code\": \"nl:0\",\n \"count\": 284,\n + {\n \"code\": \"nl:0\",\n \"count\": 284,\n \"name\": \"Netherlands\",\n \"selected\": false\n - \ },\n {\n \"code\": \"ca:0\",\n \"count\": + },\n {\n \"code\": \"ca:0\",\n \"count\": 266,\n \"name\": \"Canada\",\n \"selected\": false\n - \ },\n {\n \"code\": \"au:0\",\n \"count\": + },\n {\n \"code\": \"au:0\",\n \"count\": 195,\n \"name\": \"Australia\",\n \"selected\": false\n - \ },\n {\n \"code\": \"in:0\",\n \"count\": + },\n {\n \"code\": \"in:0\",\n \"count\": 186,\n \"name\": \"India\",\n \"selected\": false\n - \ },\n {\n \"code\": \"it:0\",\n \"count\": + },\n {\n \"code\": \"it:0\",\n \"count\": 177,\n \"name\": \"Italy\",\n \"selected\": false\n - \ },\n {\n \"code\": \"us:49\",\n \"count\": + },\n {\n \"code\": \"us:49\",\n \"count\": 173,\n \"name\": \"Greater Los Angeles Area\",\n \"selected\": false\n }\n ]\n },\n \"code\": \"location\",\n \"name\": \"Location\"\n }]\n },\n \"numResults\": 8450\n}" From 773a64ce01343b59342858686165385c65e77c95 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:37:43 -0800 Subject: [PATCH 092/117] Facets this time --- .../by_single_keywords_option_with_pagination.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml index 7d804562..f1a9f5ad 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml @@ -45,7 +45,7 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": From 58f1596f1cefb37469fed93aca8e95a0cb7a85ae Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:40:09 -0800 Subject: [PATCH 093/117] Mk all of this now --- .../_search_company/by_keywords_string_parameter.yml | 2 +- .../_search_company/by_single_keywords_option.yml | 2 +- .../by_single_keywords_option_with_facets_to_return.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml index 9d26ad1d..909d2c1a 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml @@ -51,7 +51,7 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml index d7d4b5ae..9e4b9637 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml @@ -51,7 +51,7 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"us:0\",\n \"count\": 2511,\n \"name\": \"United States\",\n \"selected\": false\n },\n {\n \"code\": diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml index b790a701..9d9a5139 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml @@ -51,7 +51,7 @@ http_interactions: \"Apple Nieuws Vlaanderen\"\n },\n {\n \"id\": 2260437,\n \"name\": \"OGGO - Services Apple Macintosh\"\n },\n {\n \"id\": 1049054,\n \"name\": \"Apple Crumble\"\n }\n ]\n - \ },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n + },\n \"facets\": {\n \"_total\": 1,\n \"values\": [{\n \"buckets\":{\n \"_total\": 10,\n \"values\": [\n {\n \"code\": \"96\",\n \"count\": 2062,\n \"name\": \"Information Technology and Services\",\n \"selected\": false\n },\n From 9f6b63d7b64213a6b70e2722b215c3aabd8a0dd5 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Thu, 30 Jan 2014 14:47:28 -0800 Subject: [PATCH 094/117] Hope this fixes it --- .../by_keywords_options_with_fields.yml | 191 +----------------- 1 file changed, 1 insertion(+), 190 deletions(-) diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml index 7927c83f..6342008b 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml @@ -37,196 +37,7 @@ http_interactions: - chunked body: encoding: UTF-8 - string: ! "{\n \"companies\": {\n \"_count\": 10,\n \"_start\": 0,\n - \"_total\": 8450,\n \"values\": [\n {\n \"description\": - \"Apple designs Macs, the best personal computers in the world, along with - OS X, iLife, iWork and professional software. Apple leads the digital music - revolution with its iPods and iTunes online store. Apple has reinvented the - mobile phone with its revolutionary iPhone and App Store, and is defining - the future of mobile media and computing devices with iPad.\",\n \"id\": - 162479,\n \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"24\",\n \"name\": \"Consumer Electronics\"\n - }]\n },\n \"name\": \"Apple\",\n \"specialties\":{\n - \"_total\": 4,\n \"values\": [\n \"Innovative - product development\",\n \"world class operations\",\n \"Retail\",\n - \"Telephone Support\"\n ]\n }\n },\n {\n - \"description\": \"Experience the Difference. \\r\\nFor over - 40 years, Apple Vacations has provided the most value in vacations to millions - of people. Throughout the years, we\\u2019ve provided what you want in a vacation - \\u2013 great service, convenience, and value. We understand just how important - your vacation is. We know because, like you, vacations are important to us - too. \\r\\n \\r\\nApple Vacations is a company of energetic, hardworking employees - with the same entrepreneurial attitudes as our founders. Headquartered just - outside Philadelphia with regional offices in Chicago and Boston, the company - is completely focused on providing quality vacations for our customers. Employees - are empowered to make decisions that impact the quality of their customers\\u2019 - vacations on a daily basis. Since our humble beginnings, Apple Vacations has - created the ultimate \\u201cbeginning-to-end\\u201d vacation experience for - customers. Apple Vacations employees will greet you at your departure airport - in more than 20 cities; and will meet your flight in our charter destinations. - Apple Vacations\\u2019 sister companies, flies customers to their destinations - from more than 20 U.S. cities; and Amstar, is the destination management company - in-resort with uniformed representatives, who will greet you upon arrival - and assist you while you are at your resort. Unlike any other travel company, - Apple Vacations truly provides the ultimate in a quality vacation experience.\",\n - \"id\": 19271,\n \"industries\": {\n \"_total\": 1,\n - \"values\": [{\n \"code\": \"30\",\n \"name\": - \"Leisure & Travel\"\n }]\n },\n \"name\": \"Apple - Vacations\",\n \"specialties\": {\n \"_total\": 2,\n \"values\": - [\n \"Leisure travel\",\n \"all inclusive vacation packages\"\n - ]\n }\n },\n {\n \"description\": \"Big - Apple International Realty has been listing, selling and managing Residential - Real Estate in four counties of the Greater Orlando and Central Florida areas - for over five years. Because our Property Management Division had grown substantially, - and to fill the growing need for property management services in Central Florida, - we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease - Only\\\" services at competitive prices, we currently manage close to 50 properties - in the Greater Orlando Area.\",\n \"id\": 778626,\n \"industries\":{\n - \"_total\": 1,\n \"values\": [{\n \"code\": - \"44\",\n \"name\": \"Real Estate\"\n }]\n },\n - \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\"\n - },\n {\n \"description\": \"Apple & Associates is an executive - search firm that specializes in the Pharmaceutical, Medical Device and Consumer - Product Industries. We provide extensive coverage of these worldwide markets - and have forged a solid reputation in the industry as a competent, aggressive, - and resource-rich recruiting firm. We are a nation-wide company with offices - through-out the United States. \\r\\n\\r\\nApple & Associates belongs to Intercity - Personnel Associates (IPA) and the Top Echelon Network. Through these worldwide - recruiting networks, we share confidentially coded information about available - positions and receive qualified candidates within a short period of time. - \ With one phone call you not only have rapid access to our candidates, but - also to qualified candidates from over 1,000 of the nation\\u2019s other top - recruiting firms. Because our executive recruiters specialize in different - industry segments, we can give you the service you deserve in a fast, focused, - and efficient manner and provide you with quality industry specific candidates. - \\r\\n\\r\\nWe realize the importance of hiring professionals who understand - and are able to assimilate with your company\\u2019s business model, culture, - process, equipment, and materials. Our team has studied the hiring decisions - that make the firms in the Pharmaceutical and Medical Device industries so - successful. Our candidates will meet the standard your company demands, with - the technical and industry background to match.\",\n \"id\": 112136,\n - \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"104\",\n \"name\": \"Staffing & Recruiting\"\n - }]\n },\n \"name\": \"Apple & Associates\",\n \"specialties\":{\n - \"_total\": 20,\n \"values\": [\n \"Medical - Device\",\n \"Pharmaceutical\",\n \"Power\",\n \"Energy\",\n - \"Consumer Products\",\n \"Supply Chain\",\n \"Purchasing\",\n - \"Engineering\",\n \"Marketing\",\n \"Sales\",\n - \"Human Resources\",\n \"Science\",\n \"Finance\",\n - \"Manufacturing\",\n \"Operations\",\n \"R&D\",\n - \"Six Sigma\",\n \"IT\",\n \"chemist\",\n - \"Executive Management\"\n ]\n }\n },\n {\n - \"description\": \"Headquartered in Singapore and a presence in 9 - countries globally, Stone Apple is a Specialized Consulting firm focused mainly - on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge - Management & Application Integration with a strong product portfolio, analytical - applications, Proprietary Industry Solutions and strong services capability - \\r\\n\\r\\nStone Apple has a strong offshore presence in SE Asia with development - centers in Vietnam and Malaysia. The Company has a strong presence and networks - in Asia Pacific, Europe and United States to support their rapidly growing - MNC enterprise customer base \\r\\n\\r\\nStone Apple provides customized solutions - to meet the changing needs of enterprises globally. From leading industry - methodologies to in-house proven models, Stone Apple collaborates with their - customers to deliver tangible business results that impact their bottom line.\",\n - \"id\": 772044,\n \"industries\": {\n \"_total\": - 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": - \"Information Technology & Services\"\n }]\n },\n \"name\": - \"Stone Apple Solutions\"\n },\n {\n \"description\": \"iSquare - S.A. is the Apple Authorised Distributor of Greece and Cyprus since September - 2010. iSquare is distributing Apple products but also plans, implements and - provides intergrated solutions, based on the innovative Apple products and - technology. iSquare's strategic goal is to increase the use of Apple products - among the Greek consumers, but also to provide users the ultimate Apple experience.\\r\\n\\r\\niSquare - creates and provides a complete ecosystem for Apple products and services, - aiming to bring Greek customers closer to Apple's philosophy. In order to - do that, iSquare:\\r\\n\\r\\n- Creates a wide network of POS (Points Of Sales) - that spreads throughout Greece and Cyprus\\r\\n\\r\\n- Develops its relations - with major retail chains in order to promote Apple products to a wide range - of customers\\r\\n\\r\\n- Creates a unique network of stores exclusively for - Apple products, always in line with the high standards of \\r\\n Apple Premium - Reseller program\\r\\n\\r\\n- Invests on continuous and in depth training - of the sales network in order to provide the best before and after sale \\r\\n - \ support, according to Apple's and iSquare's high standards\\r\\n\\r\\n- - Focuses on the crucial sector of Education\\r\\n\\r\\n- Constantly works to - improve the support of Apple products and solutions\\r\\n\\r\\n- Completes - Apple's ecosystem as the distributor of software and peripherals from well - known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, - iSquare aspires to bring the Apple products at the stature they deserve within - the Greek and Cypriot market.\",\n \"id\": 2135525,\n \"industries\":{\n - \"_total\": 1,\n \"values\": [{\n \"code\": - \"24\",\n \"name\": \"Consumer Electronics\"\n }]\n },\n - \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\"\n - },\n {\n \"description\": \"Filex (Moj Apple DuÄ\x87an i - Servis) je autorizirani Apple partner za prodaju, servis i podrÅ¡ku.\\r\\n\\r\\nFilex - je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapreÄ\x91ujemo - prepoznatljivost Apple tehnologija prezentirajuÄ\x87i upotrebnu vrijednost - Apple rjeÅ¡enja, na domaÄ\x87em i regionalnom tržiÅ¡tu.\\r\\n\\r\\nNaÅ¡ fokus - nije iskljuÄ\x8Divo na tehnologijama veÄ\x87 kako te tehnologije podrediti - potrebama korisnika. Sukladno tome, Filex nije samo joÅ¡ jedna u nizu trgovina - u koju Ä\x87ete doÄ\x87i \\\"pokupiti\\\" svoj Apple ureÄ\x91aj, veÄ\x87 mjesto - na kojem Ä\x87ete postavljati pitanja, razgovarati i diskutirati te na kraju - izaÄ\x87i sa rjeÅ¡enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte - nas preko naÅ¡eg Internet Store-a (www.filex.hr), ili nam piÅ¡ite na prodaja@filx.hr - ili servis@filex.hr.\\r\\nI svakako nam se pridružite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-DuÄ\x87an-i-Servis/131194173598671\\r\\n\\r\\nVaÅ¡e - zadovoljstvo naÅ¡a je misija!\",\n \"id\": 2303504,\n \"industries\":{\n - \"_total\": 1,\n \"values\": [{\n \"code\": - \"3\",\n \"name\": \"Computer Hardware\"\n }]\n },\n - \"name\": \"Filex Apple Store & Support\",\n \"specialties\":{\n - \"_total\": 4,\n \"values\": [\n \"Apple - Store\",\n \"Apple PodrÅ¡ka i Servis\",\n \"Apple RjeÅ¡enja\",\n - \"Apple B2B\"\n ]\n }\n },\n {\n \"description\": - \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. - AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als - de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over - Apple met zorg en proberen u zo goed mogelijk in te lichten als Apple-Fan - in Vlaanderen. Dagelijks circuleren er duizenden geruchten over Apple in het - algemeen, onze taak is deze te bundelen en u mee te delen.\\r\\n\\r\\nDit - doen we met veel liefde voor de verschillende producten en voor Apple in het - algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben - voldoende kennis over de producten van Apple.\",\n \"id\": 2419290,\n - \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"81\",\n \"name\": \"Newspapers\"\n - }]\n },\n \"name\": \"Apple Nieuws Vlaanderen\",\n - \"specialties\": {\n \"_total\": 4,\n \"values\": - [\n \"apple\",\n \"iPhone\",\n \"iPad\",\n - \"mac\"\n ]\n }\n },\n {\n \"description\": - \"OGGO est une société de conseils et solutions Apple Macintosh basée à - Genève, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos - services en un coup d'oeil :\\r\\n\\r\\n// Réparations\\r\\n// Optimisations - matérielles\\r\\n// Contrats de maintenance\\r\\n// Dépannage sur site\\r\\n// - Interventions urgentes\\r\\n// Maintenance\\r\\n// Aide à l'achat\\r\\n// - Formations\",\n \"id\": 2260437,\n \"industries\": {\n \"_total\": - 1,\n \"values\": [{\n \"code\": \"96\",\n \"name\": - \"Information Technology & Services\"\n }]\n },\n \"name\": - \"OGGO - Services Apple Macintosh\",\n \"specialties\": {\n \"_total\": - 7,\n \"values\": [\n \"Consulting & conseils Apple Macintosh\",\n - \"Support Apple Macintosh\",\n \"Maintenance Mac OS - X Server\",\n \"Dépannage Mac OS X\",\n \"Installation - Mac OS X Server\",\n \"Interventions Apple Macintosh\",\n \"Formation - Apple Macintosh\"\n ]\n }\n },\n {\n \"description\": - \"Apple-Crumble provides sound advice, sales and support for all apple mac - products and related peripherals including external hard drives, printers, - scanners and both apple and 3rd party software. Apple-Crumble are also experts - in troubleshooting, repair and maintenance. Our staff are apple trained and - certified with over 15 years experience.\\r\\n\\r\\nAll work is guaranteed - and all enquiries are welcome.\\r\\n\\r\\nWe are obviously very \\u2018pro\\u2019 - apple and firmly believe that once you go mac you never go back!\\r\\n\\r\\nFor - your convenience Apple-Crumble have our own workshop and offices with free - parking in Penzance, Cornwall so that you have the extra peace of mind knowing - that your equipment is being serviced in a clean and safe environment. You - may also view, demo and purchase new hardware or add-ons, as well as discussing - tailor-made options for you and/or your business.\\r\\n\\r\\nApple-Crumble\\u2019s - service extends to on-site visits for emergency or contract call-outs, as - well as delivery and installation of new products and systems. We cover Penzance, - Falmouth, Helston and the Lizard, St Ives, Hayle, Truro, Camborne, Redruth, - and all surrounding areas including north Cornwall and Devon\\r\\n\\r\\nIn - most cases it is safer and more cost effective to bring your hardware to us - as we are geared up for any static or time delay issues, but it is very rare - that we cannot provide a solution, wherever you may be!\",\n \"id\": - 1049054,\n \"industries\": {\n \"_total\": 1,\n \"values\": - [{\n \"code\": \"3\",\n \"name\": \"Computer Hardware\"\n - }]\n },\n \"name\": \"Apple Crumble\"\n }\n ]\n - },\n \"numResults\": 8450\n}" + string: ! "{ \"companies\": { \"_count\": 10, \"_start\": 0, \"_total\": 8450, \"values\": [ { \"description\": \"Apple designs Macs, the best personal computers in the world, along with OS X, iLife, iWork and professional software. Apple leads the digital music revolution with its iPods and iTunes online store. Apple has reinvented the mobile phone with its revolutionary iPhone and App Store, and is defining the future of mobile media and computing devices with iPad.\", \"id\": 162479, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"24\", \"name\": \"Consumer Electronics\" }] }, \"name\": \"Apple\", \"specialties\":{ \"_total\": 4, \"values\": [ \"Innovative product development\", \"world class operations\", \"Retail\", \"Telephone Support\" ] } }, { \"description\": \"Experience the Difference. \\r\\nFor over 40 years, Apple Vacations has provided the most value in vacations to millions of people. Throughout the years, we\\u2019ve provided what you want in a vacation \\u2013 great service, convenience, and value. We understand just how important your vacation is. We know because, like you, vacations are important to us too. \\r\\n \\r\\nApple Vacations is a company of energetic, hardworking employees with the same entrepreneurial attitudes as our founders. Headquartered just outside Philadelphia with regional offices in Chicago and Boston, the company is completely focused on providing quality vacations for our customers. Employees are empowered to make decisions that impact the quality of their customers\\u2019 vacations on a daily basis. Since our humble beginnings, Apple Vacations has created the ultimate \\u201cbeginning-to-end\\u201d vacation experience for customers. Apple Vacations employees will greet you at your departure airport in more than 20 cities; and will meet your flight in our charter destinations. Apple Vacations\\u2019 sister companies, flies customers to their destinations from more than 20 U.S. cities; and Amstar, is the destination management company in-resort with uniformed representatives, who will greet you upon arrival and assist you while you are at your resort. Unlike any other travel company, Apple Vacations truly provides the ultimate in a quality vacation experience.\", \"id\": 19271, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"30\", \"name\": \"Leisure & Travel\" }] }, \"name\": \"Apple Vacations\", \"specialties\": { \"_total\": 2, \"values\": [ \"Leisure travel\", \"all inclusive vacation packages\" ] } }, { \"description\": \"Big Apple International Realty has been listing, selling and managing Residential Real Estate in four counties of the Greater Orlando and Central Florida areas for over five years. Because our Property Management Division had grown substantially, and to fill the growing need for property management services in Central Florida, we founded Orlando Rental Store in 2008. In addition to providing \\\"Lease Only\\\" services at competitive prices, we currently manage close to 50 properties in the Greater Orlando Area.\", \"id\": 778626, \"industries\":{ \"_total\": 1, \"values\": [{ \"code\": \"44\", \"name\": \"Real Estate\" }] }, \"name\": \"Big Apple Holdings, Inc. dba Big Apple International Realty\" }, { \"description\": \"Apple & Associates is an executive search firm that specializes in the Pharmaceutical, Medical Device and Consumer Product Industries. We provide extensive coverage of these worldwide markets and have forged a solid reputation in the industry as a competent, aggressive, and resource-rich recruiting firm. We are a nation-wide company with offices through-out the United States. \\r\\n\\r\\nApple & Associates belongs to Intercity Personnel Associates (IPA) and the Top Echelon Network. Through these worldwide recruiting networks, we share confidentially coded information about available positions and receive qualified candidates within a short period of time. With one phone call you not only have rapid access to our candidates, but also to qualified candidates from over 1,000 of the nation\\u2019s other top recruiting firms. Because our executive recruiters specialize in different industry segments, we can give you the service you deserve in a fast, focused, and efficient manner and provide you with quality industry specific candidates. \\r\\n\\r\\nWe realize the importance of hiring professionals who understand and are able to assimilate with your company\\u2019s business model, culture, process, equipment, and materials. Our team has studied the hiring decisions that make the firms in the Pharmaceutical and Medical Device industries so successful. Our candidates will meet the standard your company demands, with the technical and industry background to match.\", \"id\": 112136, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"104\", \"name\": \"Staffing & Recruiting\" }] }, \"name\": \"Apple & Associates\", \"specialties\":{ \"_total\": 20, \"values\": [ \"Medical Device\", \"Pharmaceutical\", \"Power\", \"Energy\", \"Consumer Products\", \"Supply Chain\", \"Purchasing\", \"Engineering\", \"Marketing\", \"Sales\", \"Human Resources\", \"Science\", \"Finance\", \"Manufacturing\", \"Operations\", \"R&D\", \"Six Sigma\", \"IT\", \"chemist\", \"Executive Management\" ] } }, { \"description\": \"Headquartered in Singapore and a presence in 9 countries globally, Stone Apple is a Specialized Consulting firm focused mainly on Business Intelligence & Analytics, Enterprise Resource Planning, Knowledge Management & Application Integration with a strong product portfolio, analytical applications, Proprietary Industry Solutions and strong services capability \\r\\n\\r\\nStone Apple has a strong offshore presence in SE Asia with development centers in Vietnam and Malaysia. The Company has a strong presence and networks in Asia Pacific, Europe and United States to support their rapidly growing MNC enterprise customer base \\r\\n\\r\\nStone Apple provides customized solutions to meet the changing needs of enterprises globally. From leading industry methodologies to in-house proven models, Stone Apple collaborates with their customers to deliver tangible business results that impact their bottom line.\", \"id\": 772044, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"96\", \"name\": \"Information Technology & Services\" }] }, \"name\": \"Stone Apple Solutions\" }, { \"description\": \"iSquare S.A. is the Apple Authorised Distributor of Greece and Cyprus since September 2010. iSquare is distributing Apple products but also plans, implements and provides intergrated solutions, based on the innovative Apple products and technology. iSquare's strategic goal is to increase the use of Apple products among the Greek consumers, but also to provide users the ultimate Apple experience.\\r\\n\\r\\niSquare creates and provides a complete ecosystem for Apple products and services, aiming to bring Greek customers closer to Apple's philosophy. In order to do that, iSquare:\\r\\n\\r\\n- Creates a wide network of POS (Points Of Sales) that spreads throughout Greece and Cyprus\\r\\n\\r\\n- Develops its relations with major retail chains in order to promote Apple products to a wide range of customers\\r\\n\\r\\n- Creates a unique network of stores exclusively for Apple products, always in line with the high standards of \\r\\n Apple Premium Reseller program\\r\\n\\r\\n- Invests on continuous and in depth training of the sales network in order to provide the best before and after sale \\r\\n support, according to Apple's and iSquare's high standards\\r\\n\\r\\n- Focuses on the crucial sector of Education\\r\\n\\r\\n- Constantly works to improve the support of Apple products and solutions\\r\\n\\r\\n- Completes Apple's ecosystem as the distributor of software and peripherals from well known brands.\\r\\n\\r\\n\\r\\nWith a vision that derives from Apple's innovation, iSquare aspires to bring the Apple products at the stature they deserve within the Greek and Cypriot market.\", \"id\": 2135525, \"industries\":{ \"_total\": 1, \"values\": [{ \"code\": \"24\", \"name\": \"Consumer Electronics\" }] }, \"name\": \"iSquare - Apple Authorized Distributor in Greece & Cyprus\" }, { \"description\": \"Filex (Moj Apple DuÄ\u0087an i Servis) je autorizirani Apple partner za prodaju, servis i podrÅ¡ku.\\r\\n\\r\\nFilex je osnovan 1992 godine te od tada u kontinuitetu razvijamo i unapreÄ\u0091ujemo prepoznatljivost Apple tehnologija prezentirajuÄ\u0087i upotrebnu vrijednost Apple rjeÅ¡enja, na domaÄ\u0087em i regionalnom tržiÅ¡tu.\\r\\n\\r\\nNaÅ¡ fokus nije iskljuÄ\u008Divo na tehnologijama veÄ\u0087 kako te tehnologije podrediti potrebama korisnika. Sukladno tome, Filex nije samo joÅ¡ jedna u nizu trgovina u koju Ä\u0087ete doÄ\u0087i \\\"pokupiti\\\" svoj Apple ureÄ\u0091aj, veÄ\u0087 mjesto na kojem Ä\u0087ete postavljati pitanja, razgovarati i diskutirati te na kraju izaÄ\u0087i sa rjeÅ¡enjem - ma kako god ono na kraju izgledalo!\\r\\n\\r\\nKontaktirajte nas preko naÅ¡eg Internet Store-a (www.filex.hr), ili nam piÅ¡ite na prodaja@filx.hr ili servis@filex.hr.\\r\\nI svakako nam se pridružite na Facebook-u na http://www.facebook.com/pages/Filex-Moj-Apple-DuÄ\u0087an-i-Servis/131194173598671\\r\\n\\r\\nVaÅ¡e zadovoljstvo naÅ¡a je misija!\", \"id\": 2303504, \"industries\":{ \"_total\": 1, \"values\": [{ \"code\": \"3\", \"name\": \"Computer Hardware\" }] }, \"name\": \"Filex Apple Store & Support\", \"specialties\":{ \"_total\": 4, \"values\": [ \"Apple Store\", \"Apple PodrÅ¡ka i Servis\", \"Apple RjeÅ¡enja\", \"Apple B2B\" ] } }, { \"description\": \"Als Apple een nieuwssite zou maken in Vlaanderen, dan was het AppleVlaanderen. AppleVlaanderen is gemaakt met dezelfde passie en aandacht voor detail als de producten van Apple zelf.\\r\\n\\r\\nWe behandelen de nieuwsfeiten over Apple met zorg en proberen u zo goed mogelijk in te lichten als Apple-Fan in Vlaanderen. Dagelijks circuleren er duizenden geruchten over Apple in het algemeen, onze taak is deze te bundelen en u mee te delen.\\r\\n\\r\\nDit doen we met veel liefde voor de verschillende producten en voor Apple in het algemeen. Onze medewerkers werken allemaal op vrijwillige basis en hebben voldoende kennis over de producten van Apple.\", \"id\": 2419290, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"81\", \"name\": \"Newspapers\" }] }, \"name\": \"Apple Nieuws Vlaanderen\", \"specialties\": { \"_total\": 4, \"values\": [ \"apple\", \"iPhone\", \"iPad\", \"mac\" ] } }, { \"description\": \"OGGO est une société de conseils et solutions Apple Macintosh basée à Genève, nous proposons notre savoir faire essentiellement aux PME et particuliers.\\r\\n\\r\\nNos services en un coup d'oeil :\\r\\n\\r\\n// Réparations\\r\\n// Optimisations matérielles\\r\\n// Contrats de maintenance\\r\\n// Dépannage sur site\\r\\n// Interventions urgentes\\r\\n// Maintenance\\r\\n// Aide à l'achat\\r\\n// Formations\", \"id\": 2260437, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"96\", \"name\": \"Information Technology & Services\" }] }, \"name\": \"OGGO - Services Apple Macintosh\", \"specialties\": { \"_total\": 7, \"values\": [ \"Consulting & conseils Apple Macintosh\", \"Support Apple Macintosh\", \"Maintenance Mac OS X Server\", \"Dépannage Mac OS X\", \"Installation Mac OS X Server\", \"Interventions Apple Macintosh\", \"Formation Apple Macintosh\" ] } }, { \"description\": \"Apple-Crumble provides sound advice, sales and support for all apple mac products and related peripherals including external hard drives, printers, scanners and both apple and 3rd party software. Apple-Crumble are also experts in troubleshooting, repair and maintenance. Our staff are apple trained and certified with over 15 years experience.\\r\\n\\r\\nAll work is guaranteed and all enquiries are welcome.\\r\\n\\r\\nWe are obviously very \\u2018pro\\u2019 apple and firmly believe that once you go mac you never go back!\\r\\n\\r\\nFor your convenience Apple-Crumble have our own workshop and offices with free parking in Penzance, Cornwall so that you have the extra peace of mind knowing that your equipment is being serviced in a clean and safe environment. You may also view, demo and purchase new hardware or add-ons, as well as discussing tailor-made options for you and/or your business.\\r\\n\\r\\nApple-Crumble\\u2019s service extends to on-site visits for emergency or contract call-outs, as well as delivery and installation of new products and systems. We cover Penzance, Falmouth, Helston and the Lizard, St Ives, Hayle, Truro, Camborne, Redruth, and all surrounding areas including north Cornwall and Devon\\r\\n\\r\\nIn most cases it is safer and more cost effective to bring your hardware to us as we are geared up for any static or time delay issues, but it is very rare that we cannot provide a solution, wherever you may be!\", \"id\": 1049054, \"industries\": { \"_total\": 1, \"values\": [{ \"code\": \"3\", \"name\": \"Computer Hardware\" }] }, \"name\": \"Apple Crumble\" } ] }, \"numResults\": 8450}" http_version: '1.1' recorded_at: Tue, 04 Jun 2013 03:42:37 GMT recorded_with: VCR 2.5.0 From 428f1797147159630fa4a388d7f8c3b727ff7578 Mon Sep 17 00:00:00 2001 From: Braden Schaeffer Date: Wed, 5 Feb 2014 12:23:08 -0600 Subject: [PATCH 095/117] Fix links to examples & changelog in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8085b63a..7c1e3388 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)]( ## Usage -[View the Examples](file.EXAMPLES.html) +[View the Examples](EXAMPLES.md) ## Changelog -[View the Changelog](file.CHANGELOG.html) +[View the Changelog](CHANGELOG.md) ## TODO From 4497cec40db95d7bbf9dfdcf9f7273781154d3dc Mon Sep 17 00:00:00 2001 From: guy schaller Date: Thu, 20 Feb 2014 18:23:08 +0200 Subject: [PATCH 096/117] added example and docs for picture_urls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit really needed that feature. was happy to see it was already been implemented, just wasn’t added to the docs. --- EXAMPLES.md | 3 ++- lib/linked_in/api/people.rb | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 56cdc527..cb830c21 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -96,7 +96,8 @@ client.network_updates(:type => 'PICT') # view connections for the currently authenticated user client.connections ``` - +# get the original picture-url for one of the connections +client.picture_urls(:id => 'id_of_connection') ## Update User's Status diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index 21b50291..54739264 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -53,8 +53,15 @@ def new_connections(modified_since, options={}) simple_query(path, options) end - # TODO can't find this method in the REST API documentation and it - # doesn't seem to work when I tried it out from the command line + # Retrieve the picture url + # http://api.linkedin.com/v1/people/~/picture-urls::(original) + # + # Permissions: r_network + # + # @options [String] :id, the id of the person for whom you want the profile picture + # @options [String] :picture_size, default: 'original' + # + # example for use in code: client.picture_urls(:id => 'id_of_connection') def picture_urls(options={}) picture_size = options.delete(:picture_size) || 'original' path = "#{picture_urls_path(options)}::(#{picture_size})" From 6ad3852364cf61a11a5fd7cb0ca37187d653e046 Mon Sep 17 00:00:00 2001 From: Martin Schmidt Date: Mon, 31 Mar 2014 17:50:18 +0200 Subject: [PATCH 097/117] Updated VCR config. Use RSpec metadata options. Fixes #1 --- spec/cases/api_spec.rb | 6 +- spec/cases/oauth_spec.rb | 11 ++- spec/cases/search_spec.rb | 46 ++++------- .../should_load_correct_company_data.yml | 81 +++++++++++++++++++ .../should_return_a_valid_access_token.yml} | 0 .../LinkedIn_Client/_request_token.yml | 37 --------- .../should_return_a_valid_access_token.yml} | 0 .../should_return_a_valid_request_token.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_people_search.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_multi-email_search.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_raise_an_unauthorized_error.yml} | 0 .../should_perform_a_search.yml} | 0 .../should_perform_a_company_search.yml} | 0 .../should_perform_a_company_search.yml} | 0 .../should_return_a_facet.yml} | 0 .../should_perform_a_search.yml} | 0 spec/helper.rb | 7 +- 23 files changed, 109 insertions(+), 79 deletions(-) create mode 100644 spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml rename spec/fixtures/cassette_library/LinkedIn_Client/{_authorize_from_request.yml => _authorize_from_request/should_return_a_valid_access_token.yml} (100%) delete mode 100644 spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml rename spec/fixtures/cassette_library/LinkedIn_Client/_request_token/{with_a_callback_url.yml => with_a_callback_url/should_return_a_valid_access_token.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Client/_request_token/{with_default_options.yml => with_default_options/should_return_a_valid_request_token.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_company_name_option.yml => by_company_name_option/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_email_address.yml => by_email_address/should_perform_a_people_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_first_name_and_last_name_options.yml => by_first_name_and_last_name_options/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_first_name_and_last_name_options_with_fields.yml => by_first_name_and_last_name_options_with_fields/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_keywords_string_parameter.yml => by_keywords_string_parameter/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_multiple_email_address.yml => by_multiple_email_address/should_perform_a_multi-email_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_single_keywords_option.yml => by_single_keywords_option/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{by_single_keywords_option_with_pagination.yml => by_single_keywords_option_with_pagination/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search/{email_search_returns_unauthorized.yml => email_search_returns_unauthorized/should_raise_an_unauthorized_error.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search_company/{by_keywords_options_with_fields.yml => by_keywords_options_with_fields/should_perform_a_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search_company/{by_keywords_string_parameter.yml => by_keywords_string_parameter/should_perform_a_company_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search_company/{by_single_keywords_option.yml => by_single_keywords_option/should_perform_a_company_search.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search_company/{by_single_keywords_option_with_facets_to_return.yml => by_single_keywords_option_with_facets_to_return/should_return_a_facet.yml} (100%) rename spec/fixtures/cassette_library/LinkedIn_Search/_search_company/{by_single_keywords_option_with_pagination.yml => by_single_keywords_option_with_pagination/should_perform_a_search.yml} (100%) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index 7346ce2a..d2a528ab 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -122,8 +122,7 @@ request_token.should == "request_token" end - context "Company API" do - use_vcr_cassette + context "Company API", :vcr do it "should be able to view a company profile" do stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586").to_return(:body => "{}") @@ -200,8 +199,7 @@ end - context "Job API" do - use_vcr_cassette + context "Job API", :vcr do it "should be able to view a job listing" do stub_request(:get, "https://api.linkedin.com/v1/jobs/id=1586").to_return(:body => "{}") diff --git a/spec/cases/oauth_spec.rb b/spec/cases/oauth_spec.rb index bb9f38eb..7c16b70b 100644 --- a/spec/cases/oauth_spec.rb +++ b/spec/cases/oauth_spec.rb @@ -100,8 +100,8 @@ end describe "#request_token" do - describe "with default options" do - use_vcr_cassette :record => :new_episodes + vcr_options = { :record => :new_episodes} + describe "with default options", vcr: vcr_options do it "should return a valid request token" do request_token = client.request_token @@ -113,8 +113,7 @@ end end - describe "with a callback url" do - use_vcr_cassette :record => :new_episodes + describe "with a callback url", vcr: vcr_options do it "should return a valid access token" do request_token = client.request_token(:oauth_callback => 'http://www.josh.com') @@ -141,9 +140,9 @@ client.authorize_from_request('dummy-token', 'dummy-secret', 'dummy-pin') end - use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method] + vcr_options = { :record => :new_episodes, :match_requests_on => [ :uri, :method] } - it "should return a valid access token" do + it "should return a valid access token", vcr: vcr_options do access_token.should be_a_kind_of Array access_token[0].should be_a_kind_of String access_token[1].should be_a_kind_of String diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index 652274c0..c3924c5c 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -16,10 +16,11 @@ client end + vcr_options = { :record => :new_episodes} + describe "#search_company" do - describe "by keywords string parameter" do - use_vcr_cassette :record => :new_episodes + describe "by keywords string parameter", vcr: vcr_options do let(:results) do client.search('apple', :company) @@ -32,8 +33,7 @@ end end - describe "by single keywords option" do - use_vcr_cassette :record => :new_episodes + describe "by single keywords option", vcr: vcr_options do let(:results) do options = {:keywords => 'apple'} @@ -47,8 +47,7 @@ end end - describe "by single keywords option with facets to return" do - use_vcr_cassette :record => :new_episodes + describe "by single keywords option with facets to return", vcr: vcr_options do let(:results) do options = {:keywords => 'apple', :facets => [:industry]} @@ -60,8 +59,7 @@ end end - describe "by single keywords option with pagination" do - use_vcr_cassette :record => :new_episodes + describe "by single keywords option with pagination", vcr: vcr_options do let(:results) do options = {:keywords => 'apple', :start => 5, :count => 5} @@ -77,8 +75,7 @@ end end - describe "by keywords options with fields" do - use_vcr_cassette :record => :new_episodes + describe "by keywords options with fields", vcr: vcr_options do let(:results) do fields = [{:companies => [:id, :name, :industries, :description, :specialties]}, :num_results] @@ -96,8 +93,7 @@ describe "#search" do - describe "by keywords string parameter" do - use_vcr_cassette :record => :new_episodes + describe "by keywords string parameter", vcr: vcr_options do let(:results) do client.search('github') @@ -111,8 +107,7 @@ end end - describe "by single keywords option" do - use_vcr_cassette :record => :new_episodes + describe "by single keywords option", vcr: vcr_options do let(:results) do client.search(:keywords => 'github') @@ -126,8 +121,7 @@ end end - describe "by single keywords option with pagination" do - use_vcr_cassette :record => :new_episodes + describe "by single keywords option with pagination", vcr: vcr_options do let(:results) do client.search(:keywords => 'github', :start => 5, :count => 5) @@ -141,8 +135,7 @@ end end - describe "by first_name and last_name options" do - use_vcr_cassette :record => :new_episodes + describe "by first_name and last_name options", vcr: vcr_options do let(:results) do client.search(:first_name => 'Charles', :last_name => 'Garcia') @@ -156,8 +149,7 @@ end end - describe "by email address" do - use_vcr_cassette :record => :new_episodes + describe "by email address", vcr: vcr_options do let(:results) do fields = ['id'] @@ -174,8 +166,7 @@ end end - describe "by multiple email address" do - use_vcr_cassette :record => :new_episodes + describe "by multiple email address", vcr: vcr_options do let(:results) do fields = ['id'] @@ -189,8 +180,7 @@ end end - describe "email search returns unauthorized" do - use_vcr_cassette :record => :new_episodes + describe "email search returns unauthorized", vcr: vcr_options do it "should raise an unauthorized error" do fields = ['id'] @@ -198,8 +188,7 @@ end end - describe "by first_name and last_name options with fields" do - use_vcr_cassette :record => :new_episodes + describe "by first_name and last_name options with fields", vcr: vcr_options do let(:results) do fields = [{:people => [:id, :first_name, :last_name, :public_profile_url, :picture_url]}, :num_results] @@ -217,8 +206,7 @@ end end - describe "by company_name option" do - use_vcr_cassette :record => :new_episodes + describe "by company_name option", vcr: vcr_options do let(:results) do client.search(:company_name => 'IBM') @@ -243,4 +231,4 @@ end -end \ No newline at end of file +end diff --git a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml new file mode 100644 index 00000000..5e231240 --- /dev/null +++ b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml @@ -0,0 +1,81 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.linkedin.com/v1/companies/id=1586 + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + User-Agent: + - OAuth gem v0.4.5 + Authorization: + - OAuth oauth_consumer_key="consumer_key", oauth_nonce="nonce", oauth_signature="signature", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129843", oauth_token="token", + oauth_version="1.0" + response: + status: + code: 200 + message: OK + headers: + Server: + - Apache-Coyote/1.1 + Vary: + - ! '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Date: + - Thu, 20 Oct 2011 16:57:24 GMT + body: + encoding: UTF-8 + string: ! "{\n \"id\": 1586,\n \"name\": \"Amazon\"\n}" + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +- request: + method: get + uri: https://api.linkedin.com/v1/companies/id=1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range) + body: + encoding: US-ASCII + string: '' + headers: + X-Li-Format: + - json + User-Agent: + - OAuth gem v0.4.5 + Authorization: + - OAuth oauth_consumer_key="consumer_key", oauth_nonce="nonc", oauth_signature="signature", + oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129844", oauth_token="token", + oauth_version="1.0" + response: + status: + code: 200 + message: OK + headers: + Server: + - Apache-Coyote/1.1 + Vary: + - ! '*' + X-Li-Format: + - json + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Date: + - Thu, 20 Oct 2011 16:57:24 GMT + body: + encoding: UTF-8 + string: ! "{\n \"employeeCountRange\": {\n \"code\": \"I\",\n \"name\": + \"10001+\"\n },\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\":{\n + \"_total\": 1,\n \"values\": [{\n \"address\": {\n \"city\": + \"Seattle\",\n \"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n + \"isHeadquarters\": true\n }]\n },\n \"name\": \"Amazon\"\n}" + http_version: '1.1' + recorded_at: Wed, 10 Apr 2013 22:06:51 GMT +recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request/should_return_a_valid_access_token.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml rename to spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request/should_return_a_valid_access_token.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml deleted file mode 100644 index 733bcdec..00000000 --- a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.linkedin.com/uas/oauth/requestToken - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - OAuth gem v0.4.4 - Authorization: - - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob", - oauth_consumer_key="eAI15DqRUTTd7OuQJBG3Mo0aw2Ekx5yoLX3x3NaLnbTnZbaU46OEii7uNTKijII4", - oauth_nonce="jSQpxoXaoTl2e0dALgc7VKzRJE993wqzRWuXuF0H0", oauth_signature="wn%2Bw0Jvyb9TQ4DC8sq3CxWMDM7Y%3D", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1297093507", oauth_version="1.0" - Content-Length: - - '0' - response: - status: - code: 200 - message: OK - headers: - Content-Type: - - text/plain - Server: - - Apache-Coyote/1.1 - Date: - - Mon, 07 Feb 2011 15:45:08 GMT - Content-Length: - - '236' - body: - encoding: UTF-8 - string: oauth_token=95f8619b-7069-433b-ac9e-35dfba02b0f7&oauth_token_secret=dffd7996-6943-48ce-be6b-771e86b10f92&oauth_callback_confirmed=true&xoauth_request_auth_url=https%3A%2F%2Fapi.linkedin.com%2Fuas%2Foauth%2Fauthorize&oauth_expires_in=599 - http_version: '1.1' - recorded_at: Wed, 10 Apr 2013 22:06:51 GMT -recorded_with: VCR 2.5.0 diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url/should_return_a_valid_access_token.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml rename to spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url/should_return_a_valid_access_token.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml b/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options/should_return_a_valid_request_token.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml rename to spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options/should_return_a_valid_request_token.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address/should_perform_a_people_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_email_address/should_perform_a_people_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address/should_perform_a_multi-email_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_multiple_email_address/should_perform_a_multi-email_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized/should_raise_an_unauthorized_error.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search/email_search_returns_unauthorized/should_raise_an_unauthorized_error.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields/should_perform_a_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter/should_perform_a_company_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter/should_perform_a_company_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option/should_perform_a_company_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option/should_perform_a_company_search.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return/should_return_a_facet.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return/should_return_a_facet.yml diff --git a/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml b/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination/should_perform_a_search.yml similarity index 100% rename from spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml rename to spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination/should_perform_a_search.yml diff --git a/spec/helper.rb b/spec/helper.rb index 159e70b9..b0765d65 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -10,15 +10,16 @@ require 'webmock/rspec' require 'vcr' -VCR.config do |c| +VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/cassette_library' - c.stub_with :webmock + c.hook_into :webmock c.ignore_localhost = true c.default_cassette_options = { :record => :none } + c.configure_rspec_metadata! end RSpec.configure do |c| - c.extend VCR::RSpec::Macros + c.treat_symbols_as_metadata_keys_with_true_values = true end def linkedin_url(url) From 3abb630088748cfb4bb600bb81fc815469434a59 Mon Sep 17 00:00:00 2001 From: Robert Bradford Date: Tue, 15 Apr 2014 13:30:16 -0700 Subject: [PATCH 098/117] Bumped hashie dependency --- linkedin.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkedin.gemspec b/linkedin.gemspec index c8e57ffe..bac2de26 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -2,7 +2,7 @@ require File.expand_path('../lib/linked_in/version', __FILE__) Gem::Specification.new do |gem| - gem.add_dependency 'hashie', ['>= 1.2', '< 2.1'] + gem.add_dependency 'hashie', '~> 2.0' gem.add_dependency 'multi_json', '~> 1.0' gem.add_dependency 'oauth', '~> 0.4' # gem.add_development_dependency 'json', '~> 1.6' From 64ae382d6e91448d25d9512ef2ce1cea73e700ea Mon Sep 17 00:00:00 2001 From: Tommy Date: Tue, 6 May 2014 17:10:51 -0400 Subject: [PATCH 099/117] Update query_helpers.rb Remove "id=" parameter from company path --- lib/linked_in/api/query_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/api/query_helpers.rb b/lib/linked_in/api/query_helpers.rb index 93b36385..a1be84fe 100644 --- a/lib/linked_in/api/query_helpers.rb +++ b/lib/linked_in/api/query_helpers.rb @@ -56,7 +56,7 @@ def company_path(options) if domain = options.delete(:domain) path += "?email-domain=#{CGI.escape(domain)}" elsif id = options.delete(:id) - path += "/id=#{id}" + path += "/#{id}" elsif url = options.delete(:url) path += "/url=#{CGI.escape(url)}" elsif name = options.delete(:name) From f933456d121d92b2732e85229e301da2243f90c0 Mon Sep 17 00:00:00 2001 From: guy schaller Date: Mon, 30 Jun 2014 01:11:34 -0400 Subject: [PATCH 100/117] added example and docs for secure image over https started using this parameter in my code. thought it should be added to the docs. --- EXAMPLES.md | 2 ++ lib/linked_in/api/people.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/EXAMPLES.md b/EXAMPLES.md index cb830c21..e291b4f6 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -98,6 +98,8 @@ client.connections ``` # get the original picture-url for one of the connections client.picture_urls(:id => 'id_of_connection') +# get the image over https instead of http +client.picture_urls(:id => 'id_of_connection', :secure => "true") ## Update User's Status diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index 54739264..86767583 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -60,6 +60,7 @@ def new_connections(modified_since, options={}) # # @options [String] :id, the id of the person for whom you want the profile picture # @options [String] :picture_size, default: 'original' + # @options [String] :secure, default: 'false', options: ['false','true'] # # example for use in code: client.picture_urls(:id => 'id_of_connection') def picture_urls(options={}) From 592f583b437540fded6e892cae9f8b08e4ab1a31 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Mon, 4 Aug 2014 10:36:04 -0700 Subject: [PATCH 101/117] New dependencies Fixes #234 --- lib/linked_in/version.rb | 6 +++--- linkedin.gemspec | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 48fcafc5..76555902 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -1,9 +1,9 @@ module LinkedIn module VERSION #:nodoc: - MAJOR = 0 - MINOR = 4 - PATCH = 5 + MAJOR = 1 + MINOR = 0 + PATCH = 0 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end diff --git a/linkedin.gemspec b/linkedin.gemspec index bac2de26..ac2f6d4f 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -2,7 +2,7 @@ require File.expand_path('../lib/linked_in/version', __FILE__) Gem::Specification.new do |gem| - gem.add_dependency 'hashie', '~> 2.0' + gem.add_dependency 'hashie', '~> 3.0' gem.add_dependency 'multi_json', '~> 1.0' gem.add_dependency 'oauth', '~> 0.4' # gem.add_development_dependency 'json', '~> 1.6' From 427d10e1378646ff1e6e24e5dc8dc891ee8139c2 Mon Sep 17 00:00:00 2001 From: Sahil Dhankhar Date: Sun, 10 Aug 2014 20:41:54 +0530 Subject: [PATCH 102/117] Build Fix This fixes the build by stubbing few api's --- spec/cases/api_spec.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index d2a528ab..ef353005 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -125,7 +125,7 @@ context "Company API", :vcr do it "should be able to view a company profile" do - stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586").to_return(:body => "{}") client.company(:id => 1586).should be_an_instance_of(LinkedIn::Mash) end @@ -150,8 +150,9 @@ end it "should load correct company data" do + stub_request(:get, "https://api.linkedin.com/v1/companies/1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range)").to_return(:body => "{\"id\":1586,\"name\":\"Amazon\",\"employee_count_range\":{\"name\":\"10001+\"},\"industry\":\"Internet\",\"locations\":{\"all\":[{\"address\":{\"city\":\"Seattle\"},\"is_headquarters\":true}]}}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586").to_return(:body => "{\"id\":1586,\"name\":\"Amazon\"}") client.company(:id => 1586).name.should == "Amazon" - data = client.company(:id => 1586, :fields => %w{ id name industry locations:(address:(city state country-code) is-headquarters) employee-count-range }) data.id.should == 1586 data.name.should == "Amazon" @@ -162,22 +163,22 @@ end it "should be able to view company_updates" do - stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586/updates").to_return(:body => "{}") client.company_updates(:id => 1586).should be_an_instance_of(LinkedIn::Mash) end it "should be able to view company_statistic" do - stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/company-statistics").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586/company-statistics").to_return(:body => "{}") client.company_statistics(:id => 1586).should be_an_instance_of(LinkedIn::Mash) end it "should be able to view company updates comments" do - stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/update-comments").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586/updates/key=company_update_key/update-comments").to_return(:body => "{}") client.company_updates_comments("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash) end it "should be able to view company updates likes" do - stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/likes").to_return(:body => "{}") + stub_request(:get, "https://api.linkedin.com/v1/companies/1586/updates/key=company_update_key/likes").to_return(:body => "{}") client.company_updates_likes("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash) end From 7c358d8cc7979b3a1d0331dc416e8788f56d9f87 Mon Sep 17 00:00:00 2001 From: Lee Reilly Date: Tue, 12 Aug 2014 11:04:06 -0700 Subject: [PATCH 103/117] Code fencing fix --- EXAMPLES.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index e291b4f6..ee483571 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -71,7 +71,7 @@ Here's an example of sending a message to two recipients # client is a LinkedIn::Client -# send a message to a person in your network. you will need to authenticate the +# send a message to a person in your network. you will need to authenticate the # user and ask for the "w_messages" permission. response = client.send_message("subject", "body", ["person_1_id", "person_2_id"]) ``` @@ -95,12 +95,13 @@ client.network_updates(:type => 'PICT') # view connections for the currently authenticated user client.connections -``` + # get the original picture-url for one of the connections client.picture_urls(:id => 'id_of_connection') + # get the image over https instead of http client.picture_urls(:id => 'id_of_connection', :secure => "true") - +``` ## Update User's Status Here's an example of updating the current user's status @@ -132,22 +133,22 @@ helpers do def login? !session[:atoken].nil? end - + def profile linkedin_client.profile unless session[:atoken].nil? end - + def connections linkedin_client.connections unless session[:atoken].nil? end - + private def linkedin_client client = LinkedIn::Client.new(settings.api, settings.secret) client.authorize_from_access(session[:atoken], session[:asecret]) client - end - + end + end configure do @@ -180,7 +181,7 @@ get "/auth/callback" do pin = params[:oauth_verifier] atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin) session[:atoken] = atoken - session[:asecret] = asecret + session[:asecret] = asecret end redirect "/" end From 74fabb9ee3c0d1b54745777f1ce183cc01f7ff77 Mon Sep 17 00:00:00 2001 From: Thierry Joyal Date: Sat, 11 Oct 2014 21:35:36 +0000 Subject: [PATCH 104/117] Fix example for client.request_token scope --- EXAMPLES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index ee483571..a84a6521 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -13,7 +13,7 @@ client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') # If you want to use one of the scopes from linkedin you have to pass it in at this point # You can learn more about it here: http://developer.linkedin.com/documents/authentication -request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") +request_token = client.request_token({}, :scope => "r_basicprofile r_emailaddress") rtoken = request_token.token rsecret = request_token.secret From 677ad93ff9475077035a6ca32c28b2386abe0542 Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Thu, 23 Oct 2014 19:13:59 -0400 Subject: [PATCH 105/117] Start on porting this over to oauth2 --- EXAMPLES.md | 18 ++- lib/linked_in/helpers/authorization.rb | 37 +++--- lib/linked_in/helpers/request.rb | 16 +-- lib/linkedin.rb | 2 +- linkedin.gemspec | 2 +- spec/cases/api_spec.rb | 63 ++++------ spec/cases/oauth_spec.rb | 116 +++--------------- spec/cases/search_spec.rb | 3 +- .../should_load_correct_company_data.yml | 14 ++- 9 files changed, 83 insertions(+), 188 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index ee483571..9acceebf 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,6 +1,6 @@ # Linkedin Gem Examples -## OAuth 1.0a Authentication +## OAuth2 Authentication Here's an example of authenticating with the LinkedIn API @@ -13,22 +13,18 @@ client = LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret') # If you want to use one of the scopes from linkedin you have to pass it in at this point # You can learn more about it here: http://developer.linkedin.com/documents/authentication -request_token = client.request_token({}, :scope => "r_basicprofile+r_emailaddress") - -rtoken = request_token.token -rsecret = request_token.secret # to test from your desktop, open the following url in your browser # and record the pin it gives you -request_token.authorize_url -=> "https://api.linkedin.com/uas/oauth/authorize?oauth_token=" +client.authorize_url(:redirect_uri => 'https:://www.yourdomain.com/callback', :state => SecureRandom.uuid, :scope => "r_basicprofile+r_emailaddress") +=> "https://api.linkedin.com/uas/oauth2/authorization?" # then fetch your access keys -client.authorize_from_request(rtoken, rsecret, pin) -=> ["OU812", "8675309"] # <= save these for future requests +client.authorize_from_request(code, :redirect_uri => 'https:://www.yourdomain.com/callback') +=> "OU812" # <= save this for future requests # or authorize from previously fetched access keys -client.authorize_from_access("OU812", "8675309") +client.authorize_from_access("OU812") # you're now free to move about the cabin, call any API method ``` @@ -145,7 +141,7 @@ helpers do private def linkedin_client client = LinkedIn::Client.new(settings.api, settings.secret) - client.authorize_from_access(session[:atoken], session[:asecret]) + client.authorize_from_access(session[:atoken]) client end diff --git a/lib/linked_in/helpers/authorization.rb b/lib/linked_in/helpers/authorization.rb index 01af0b71..1a2f9720 100644 --- a/lib/linked_in/helpers/authorization.rb +++ b/lib/linked_in/helpers/authorization.rb @@ -4,38 +4,32 @@ module Helpers module Authorization DEFAULT_OAUTH_OPTIONS = { - :request_token_path => "/uas/oauth/requestToken", - :access_token_path => "/uas/oauth/accessToken", - :authorize_path => "/uas/oauth/authorize", + :token_path => "/uas/oauth2/accessToken", + :authorize_path => "/uas/oauth2/authorization", :api_host => "https://api.linkedin.com", :auth_host => "https://www.linkedin.com" } def consumer - @consumer ||= ::OAuth::Consumer.new(@consumer_token, @consumer_secret, parse_oauth_options) - end - - # Note: If using oauth with a web app, be sure to provide :oauth_callback. - # Options: - # :oauth_callback => String, url that LinkedIn should redirect to - def request_token(options={}, *arguments, &block) - @request_token ||= consumer.get_request_token(options, *arguments, &block) + @consumer ||= ::OAuth2::Client.new(@consumer_token, @consumer_secret, parse_oauth_options) end # For web apps use params[:oauth_verifier], for desktop apps, # use the verifier is the pin that LinkedIn gives users. - def authorize_from_request(request_token, request_secret, verifier_or_pin) - request_token = ::OAuth::RequestToken.new(consumer, request_token, request_secret) - access_token = request_token.get_access_token(:oauth_verifier => verifier_or_pin) - @auth_token, @auth_secret = access_token.token, access_token.secret + def authorize_from_request(code, params = {}) + @auth_token = consumer.auth_code.get_token(code, params).token end def access_token - @access_token ||= ::OAuth::AccessToken.new(consumer, @auth_token, @auth_secret) + @access_token ||= ::OAuth2::AccessToken.new(consumer, @auth_token) + end + + def authorize_url(params = {}) + consumer.auth_code.authorize_url(params) end - def authorize_from_access(atoken, asecret) - @auth_token, @auth_secret = atoken, asecret + def authorize_from_access(atoken) + @auth_token = atoken end private @@ -45,11 +39,10 @@ def authorize_from_access(atoken, asecret) # of the url creation ourselves. def parse_oauth_options { - :request_token_url => full_oauth_url_for(:request_token, :api_host), - :access_token_url => full_oauth_url_for(:access_token, :api_host), - :authorize_url => full_oauth_url_for(:authorize, :auth_host), + :token_url => full_oauth_url_for(:token, :api_host), + :authorize_url => full_oauth_url_for(:authorize, :auth_host), :site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host], - :proxy => @consumer_options.fetch(:proxy, nil) + :raise_errors => false } end diff --git a/lib/linked_in/helpers/request.rb b/lib/linked_in/helpers/request.rb index 94f66592..ee4f9c13 100644 --- a/lib/linked_in/helpers/request.rb +++ b/lib/linked_in/helpers/request.rb @@ -12,25 +12,25 @@ module Request protected def get(path, options={}) - response = access_token.get("#{API_PATH}#{path}", DEFAULT_HEADERS.merge(options)) + response = access_token.get("#{API_PATH}#{path}", {:headers => DEFAULT_HEADERS.merge(options)}) raise_errors(response) response.body end def post(path, body='', options={}) - response = access_token.post("#{API_PATH}#{path}", body, DEFAULT_HEADERS.merge(options)) + response = access_token.post("#{API_PATH}#{path}", {:body => body, :headers => DEFAULT_HEADERS.merge(options)}) raise_errors(response) response end def put(path, body, options={}) - response = access_token.put("#{API_PATH}#{path}", body, DEFAULT_HEADERS.merge(options)) + response = access_token.put("#{API_PATH}#{path}", {:body => body, :headers => DEFAULT_HEADERS.merge(options)}) raise_errors(response) response end def delete(path, options={}) - response = access_token.delete("#{API_PATH}#{path}", DEFAULT_HEADERS.merge(options)) + response = access_token.delete("#{API_PATH}#{path}", {:headers => DEFAULT_HEADERS.merge(options)}) raise_errors(response) response end @@ -40,7 +40,7 @@ def delete(path, options={}) def raise_errors(response) # Even if the json answer contains the HTTP status code, LinkedIn also sets this code # in the HTTP answer (thankfully). - case response.code.to_i + case response.status.to_i when 401 data = Mash.from_json(response.body) raise LinkedIn::Errors::UnauthorizedError.new(data), "(#{data.status}): #{data.message}" @@ -51,11 +51,11 @@ def raise_errors(response) data = Mash.from_json(response.body) raise LinkedIn::Errors::AccessDeniedError.new(data), "(#{data.status}): #{data.message}" when 404 - raise LinkedIn::Errors::NotFoundError, "(#{response.code}): #{response.message}" + raise LinkedIn::Errors::NotFoundError, "(#{response.status}): #{response.message}" when 500 - raise LinkedIn::Errors::InformLinkedInError, "LinkedIn had an internal error. Please let them know in the forum. (#{response.code}): #{response.message}" + raise LinkedIn::Errors::InformLinkedInError, "LinkedIn had an internal error. Please let them know in the forum. (#{response.status}): #{response.message}" when 502..503 - raise LinkedIn::Errors::UnavailableError, "(#{response.code}): #{response.message}" + raise LinkedIn::Errors::UnavailableError, "(#{response.status}): #{response.message}" end end diff --git a/lib/linkedin.rb b/lib/linkedin.rb index 513f55ca..c17305ea 100644 --- a/lib/linkedin.rb +++ b/lib/linkedin.rb @@ -1,4 +1,4 @@ -require 'oauth' +require 'oauth2' module LinkedIn diff --git a/linkedin.gemspec b/linkedin.gemspec index ac2f6d4f..2fc9355f 100644 --- a/linkedin.gemspec +++ b/linkedin.gemspec @@ -4,7 +4,7 @@ require File.expand_path('../lib/linked_in/version', __FILE__) Gem::Specification.new do |gem| gem.add_dependency 'hashie', '~> 3.0' gem.add_dependency 'multi_json', '~> 1.0' - gem.add_dependency 'oauth', '~> 0.4' + gem.add_dependency 'oauth2', '~> 1.0' # gem.add_development_dependency 'json', '~> 1.6' gem.add_development_dependency 'rake', '~> 10' gem.add_development_dependency 'yard' diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index d2a528ab..bad211bc 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -4,11 +4,11 @@ before do LinkedIn.default_profile_fields = nil client.stub(:consumer).and_return(consumer) - client.authorize_from_access('atoken', 'asecret') + client.authorize_from_access('77j2rfbjbmkcdh') end let(:client){LinkedIn::Client.new('token', 'secret')} - let(:consumer){OAuth::Consumer.new('token', 'secret', {:site => 'https://api.linkedin.com'})} + let(:consumer){OAuth2::Client.new('token', 'secret', {:site => 'https://api.linkedin.com', :raise_errors => false})} it "should be able to view the account profile" do stub_request(:get, "https://api.linkedin.com/v1/people/~").to_return(:body => "{}") @@ -70,15 +70,15 @@ it "should be able to share a new status" do stub_request(:post, "https://api.linkedin.com/v1/people/~/shares").to_return(:body => "", :status => 201) response = client.add_share(:comment => "Testing, 1, 2, 3") - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "should be able to share a new company status" do stub_request(:post, "https://api.linkedin.com/v1/companies/123456/shares").to_return(:body => "", :status => 201) response = client.add_company_share("123456", { :comment => "Testing, 1, 2, 3" }) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "returns the shares for a person" do @@ -91,35 +91,24 @@ stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return( :body => "", :status => 201) response = client.update_comment('SOMEKEY', "Testing, 1, 2, 3") - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "should be able to like a network update" do stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). with(:body => "true").to_return(:body => "", :status => 201) response = client.like_share('SOMEKEY') - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "should be able to unlike a network update" do stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked"). with(:body => "false").to_return(:body => "", :status => 201) response = client.unlike_share('SOMEKEY') - response.body.should == nil - response.code.should == "201" - end - - it "should be able to pass down the additional arguments to OAuth's get_request_token" do - consumer.should_receive(:get_request_token).with( - {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus").and_return("request_token") - - request_token = client.request_token( - {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus" - ) - - request_token.should == "request_token" + response.body.should == "" + response.status.should == 201 end context "Company API", :vcr do @@ -185,16 +174,16 @@ stub_request(:post, "https://api.linkedin.com/v1/people/~/following/companies").to_return(:body => "", :status => 201) response = client.follow_company(1586) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "should be able to unfollow a company" do stub_request(:delete, "https://api.linkedin.com/v1/people/~/following/companies/id=1586").to_return(:body => "", :status => 201) response = client.unfollow_company(1586) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end end @@ -219,8 +208,8 @@ it "should be able to add a bookmark" do stub_request(:post, "https://api.linkedin.com/v1/people/~/job-bookmarks").to_return(:body => "", :status => 201) response = client.add_job_bookmark(:id => 1452577) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end end @@ -246,8 +235,8 @@ stub_request(:put, "https://api.linkedin.com/v1/people/~/group-memberships/123").to_return(:body => "", :status => 201) response = client.join_group(123) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end it "should be able to list a group profile" do @@ -273,15 +262,15 @@ stub_request(:post, "https://api.linkedin.com/v1/groups/123/posts").with(:body => expected).to_return(:body => "", :status => 201) response = client.post_group_discussion(123, expected) - response.body.should == nil - response.code.should == '201' + response.body.should == "" + response.status.should == 201 end it "should be able to share a new group status" do stub_request(:post, "https://api.linkedin.com/v1/groups/1/posts").to_return(:body => "", :status => 201) response = client.add_group_share(1, :comment => "Testing, 1, 2, 3") - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end end @@ -289,8 +278,8 @@ it "should be able to send a message" do stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201) response = client.send_message("subject", "body", ["recip1", "recip2"]) - response.body.should == nil - response.code.should == "201" + response.body.should == "" + response.status.should == 201 end end diff --git a/spec/cases/oauth_spec.rb b/spec/cases/oauth_spec.rb index 7c16b70b..1c9bd4be 100644 --- a/spec/cases/oauth_spec.rb +++ b/spec/cases/oauth_spec.rb @@ -14,22 +14,8 @@ it "should return a configured OAuth consumer" do consumer.site.should == 'https://api.linkedin.com' - consumer.request_token_url.should == 'https://api.linkedin.com/uas/oauth/requestToken' - consumer.access_token_url.should == 'https://api.linkedin.com/uas/oauth/accessToken' - consumer.authorize_url.should == 'https://www.linkedin.com/uas/oauth/authorize' - end - end - - describe "proxy oauth options" do - let(:proxy) { "http://dummy.proxy" } - let(:consumer) do - LinkedIn::Client.new('1234', '1234', { - :proxy => proxy, - }).consumer - end - - it "should send requests though proxy" do - consumer.proxy.should eq proxy + consumer.token_url.should == 'https://api.linkedin.com/uas/oauth2/accessToken' + consumer.authorize_url.should == 'https://www.linkedin.com/uas/oauth2/authorization' end end @@ -43,43 +29,38 @@ it "should return a configured OAuth consumer" do consumer.site.should == 'https://api.josh.com' - consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken' - consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken' - consumer.authorize_url.should == 'https://www.josh.com/uas/oauth/authorize' + consumer.token_url.should == 'https://api.josh.com/uas/oauth2/accessToken' + consumer.authorize_url.should == 'https://www.josh.com/uas/oauth2/authorization' end end describe "different oauth paths" do let(:consumer) do LinkedIn::Client.new('1234', '1234', { - :request_token_path => "/secure/oauth/requestToken", - :access_token_path => "/secure/oauth/accessToken", - :authorize_path => "/secure/oauth/authorize", + :token_path => "/secure/oauth2/accessToken", + :authorize_path => "/secure/oauth2/authorization", }).consumer end it "should return a configured OAuth consumer" do consumer.site.should == 'https://api.linkedin.com' - consumer.request_token_url.should == 'https://api.linkedin.com/secure/oauth/requestToken' - consumer.access_token_url.should == 'https://api.linkedin.com/secure/oauth/accessToken' - consumer.authorize_url.should == 'https://www.linkedin.com/secure/oauth/authorize' + consumer.token_url.should == 'https://api.linkedin.com/secure/oauth2/accessToken' + consumer.authorize_url.should == 'https://www.linkedin.com/secure/oauth2/authorization' end end describe "specify oauth urls" do let(:consumer) do LinkedIn::Client.new('1234', '1234', { - :request_token_url => "https://api.josh.com/secure/oauth/requestToken", - :access_token_url => "https://api.josh.com/secure/oauth/accessToken", - :authorize_url => "https://www.josh.com/secure/oauth/authorize", + :token_url => "https://api.josh.com/secure/oauth2/accessToken", + :authorize_url => "https://www.josh.com/secure/oauth2/authorization", }).consumer end it "should return a configured OAuth consumer" do consumer.site.should == 'https://api.linkedin.com' - consumer.request_token_url.should == 'https://api.josh.com/secure/oauth/requestToken' - consumer.access_token_url.should == 'https://api.josh.com/secure/oauth/accessToken' - consumer.authorize_url.should == 'https://www.josh.com/secure/oauth/authorize' + consumer.token_url.should == 'https://api.josh.com/secure/oauth2/accessToken' + consumer.authorize_url.should == 'https://www.josh.com/secure/oauth2/authorization' end end @@ -92,87 +73,22 @@ it "should return a configured OAuth consumer" do consumer.site.should == 'https://api.josh.com' - consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken' - consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken' - consumer.authorize_url.should == 'https://api.josh.com/uas/oauth/authorize' + consumer.token_url.should == 'https://api.josh.com/uas/oauth2/accessToken' + consumer.authorize_url.should == 'https://api.josh.com/uas/oauth2/authorization' end end end - describe "#request_token" do - vcr_options = { :record => :new_episodes} - describe "with default options", vcr: vcr_options do - - it "should return a valid request token" do - request_token = client.request_token - - request_token.should be_a_kind_of OAuth::RequestToken - request_token.authorize_url.should include("https://www.linkedin.com/uas/oauth/authorize?oauth_token=") - - a_request(:post, "https://api.linkedin.com/uas/oauth/requestToken").should have_been_made.once - end - end - - describe "with a callback url", vcr: vcr_options do - - it "should return a valid access token" do - request_token = client.request_token(:oauth_callback => 'http://www.josh.com') - - request_token.should be_a_kind_of OAuth::RequestToken - request_token.authorize_url.should include("https://www.linkedin.com/uas/oauth/authorize?oauth_token=") - request_token.callback_confirmed?.should == true - - a_request(:post, "https://api.linkedin.com/uas/oauth/requestToken").should have_been_made.once - end - end - end - - describe "#authorize_from_request" do - let(:access_token) do - # if you remove the related casssette you will need to do the following - # authorize_from_request request manually - # - # request_token = client.request_token - # puts "token : #{request_token.token} - secret #{request_token.secret}" - # puts "auth url : #{request_token.authorize_url}" - # raise 'keep note of the token and secret' - # - client.authorize_from_request('dummy-token', 'dummy-secret', 'dummy-pin') - end - - vcr_options = { :record => :new_episodes, :match_requests_on => [ :uri, :method] } - - it "should return a valid access token", vcr: vcr_options do - access_token.should be_a_kind_of Array - access_token[0].should be_a_kind_of String - access_token[1].should be_a_kind_of String - - a_request(:post, "https://api.linkedin.com/uas/oauth/accessToken").should have_been_made.once - end - end - describe "#access_token" do let(:access_token) do - client.authorize_from_access('dummy-token', 'dummy-secret') + client.authorize_from_access('dummy-token') client.access_token end it "should return a valid auth token" do - access_token.should be_a_kind_of OAuth::AccessToken + access_token.should be_a_kind_of OAuth2::AccessToken access_token.token.should be_a_kind_of String end end - describe "#authorize_from_access" do - let(:auth_token) do - client.authorize_from_access('dummy-token', 'dummy-secret') - end - - it "should return a valid auth token" do - auth_token.should be_a_kind_of Array - auth_token[0].should be_a_kind_of String - auth_token[1].should be_a_kind_of String - end - end - end diff --git a/spec/cases/search_spec.rb b/spec/cases/search_spec.rb index c3924c5c..27aeb817 100644 --- a/spec/cases/search_spec.rb +++ b/spec/cases/search_spec.rb @@ -11,8 +11,7 @@ client = LinkedIn::Client.new(consumer_token, consumer_secret) auth_token = ENV['LINKED_IN_AUTH_KEY'] || 'key' - auth_secret = ENV['LINKED_IN_AUTH_SECRET'] || 'secret' - client.authorize_from_access(auth_token, auth_secret) + client.authorize_from_access(auth_token) client end diff --git a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml index 5e231240..d0b59dce 100644 --- a/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml +++ b/spec/fixtures/cassette_library/LinkedIn_Api/Company_API/should_load_correct_company_data.yml @@ -2,19 +2,21 @@ http_interactions: - request: method: get - uri: https://api.linkedin.com/v1/companies/id=1586 + uri: https://api.linkedin.com/v1/companies/1586 body: encoding: US-ASCII string: '' headers: + User-Agent: + - Faraday v0.9.0 X-Li-Format: - json - User-Agent: - - OAuth gem v0.4.5 Authorization: - - OAuth oauth_consumer_key="consumer_key", oauth_nonce="nonce", oauth_signature="signature", - oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129843", oauth_token="token", - oauth_version="1.0" + - Bearer atoken + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" response: status: code: 200 From aa858f00cecb1b528740122b067160a157fb556d Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Tue, 29 Dec 2015 15:17:18 -0300 Subject: [PATCH 106/117] Add ability to fetch a single share --- lib/linked_in/api/share_and_social_stream.rb | 5 +++++ spec/cases/api_spec.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb index e9f2b4d9..8ada35d6 100644 --- a/lib/linked_in/api/share_and_social_stream.rb +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -42,6 +42,11 @@ def shares(options={}) simple_query(path, {:type => "SHAR", :scope => "self"}.merge(options)) end + def share(update_key, options={}) + path = "#{person_path(options)}/network/updates/key=#{update_key}" + simple_query(path, options) + end + # Retrieve all comments for a particular network update # # @note The first 5 comments are included in the response to #network_updates diff --git a/spec/cases/api_spec.rb b/spec/cases/api_spec.rb index d2a528ab..54681795 100644 --- a/spec/cases/api_spec.rb +++ b/spec/cases/api_spec.rb @@ -87,6 +87,11 @@ client.shares(:after => 1234, :count => 35) end + it "should be able to fetch a single share" do + stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key").to_return(:body => "{}") + client.share("network_update_key").should be_an_instance_of(LinkedIn::Mash) + end + it "should be able to comment on network update" do stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return( :body => "", :status => 201) From f59a8a3980a7da512e27962d9587af2b7a5229e9 Mon Sep 17 00:00:00 2001 From: Matt Kirk Date: Tue, 26 Jan 2016 17:11:03 -0800 Subject: [PATCH 107/117] Bump version --- lib/linked_in/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index 76555902..bbefa9d3 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -2,7 +2,7 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 1 - MINOR = 0 + MINOR = 1 PATCH = 0 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') From b5626eb0aba8a693fbdb6c5dbb9818890aee4adc Mon Sep 17 00:00:00 2001 From: Abhinay Kumar Date: Fri, 22 Apr 2016 19:41:55 +0530 Subject: [PATCH 108/117] Update links for Companies API --- lib/linked_in/api/companies.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/linked_in/api/companies.rb b/lib/linked_in/api/companies.rb index 1110c100..af4ecb76 100644 --- a/lib/linked_in/api/companies.rb +++ b/lib/linked_in/api/companies.rb @@ -3,8 +3,8 @@ module Api # Companies API # - # @see http://developer.linkedin.com/documents/companies Companies API - # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields Company Fields + # @see https://developer.linkedin.com/docs/company-pages Companies API + # @see https://developer.linkedin.com/docs/fields/companies Company Fields # # The following API actions do not have corresponding methods in # this module @@ -18,7 +18,8 @@ module Companies # Retrieve a Company Profile # - # @see http://developer.linkedin.com/documents/company-lookup-api-and-fields + # @see https://developer.linkedin.com/docs/fields/company-profile Company Profile field + # @see https://developer.linkedin.com/docs/company-pages#company_profile Company Profile # # @macro company_path_options # @option options [String] :scope @@ -33,7 +34,7 @@ def company(options = {}) # Retrieve a feed of event items for a Company # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#get_update Get Specific Company Update # # @macro company_path_options # @option options [String] :event-type @@ -49,7 +50,7 @@ def company_updates(options={}) # # Permissions: rw_company_admin # - # @see http://developer.linkedin.com/documents/company-statistics + # @see https://developer.linkedin.com/docs/company-pages#statistics Get Company Statistics # # @macro company_path_options # @return [LinkedIn::Mash] @@ -60,7 +61,7 @@ def company_statistics(options={}) # Retrieve comments on a particular company update: # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#get_update_comments Get comments for a specific Company update # # @param [String] update_key a update/update-key representing a # particular company update @@ -73,7 +74,7 @@ def company_updates_comments(update_key, options={}) # Retrieve likes on a particular company update: # - # @see http://developer.linkedin.com/reading-company-shares + # @see https://developer.linkedin.com/docs/company-pages#get_update_likes Get likes for a specific Company update # # @param [String] update_key a update/update-key representing a # particular company update @@ -89,8 +90,8 @@ def company_updates_likes(update_key, options={}) # # Permissions: rw_company_admin # - # @see http://developer.linkedin.com/creating-company-shares - # @see http://developer.linkedin.com/documents/targeting-company-shares Targeting Company Shares + # @see https://developer.linkedin.com/docs/company-pages#company_share Create a company share + # @see https://developer.linkedin.com/docs/company-pages#targetting_shares Targeting company shares # # @param [String] company_id Company ID # @macro share_input_fields From 1cb42739a96e54b80412809d9d4ef4f19112f657 Mon Sep 17 00:00:00 2001 From: Abhinay Kumar Date: Thu, 28 Apr 2016 08:34:32 +0530 Subject: [PATCH 109/117] Update documentation links --- lib/linked_in/api/communications.rb | 2 +- lib/linked_in/api/companies.rb | 6 +++--- lib/linked_in/api/people.rb | 6 +++--- lib/linked_in/api/share_and_social_stream.rb | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/linked_in/api/communications.rb b/lib/linked_in/api/communications.rb index b6ac9983..c4ecf3c0 100644 --- a/lib/linked_in/api/communications.rb +++ b/lib/linked_in/api/communications.rb @@ -24,7 +24,7 @@ module Communications # message # @return [void] def send_message(subject, body, recipient_paths) - path = "/people/~/mailbox" + path = '/people/~/mailbox' message = { 'subject' => subject, diff --git a/lib/linked_in/api/companies.rb b/lib/linked_in/api/companies.rb index af4ecb76..567016ff 100644 --- a/lib/linked_in/api/companies.rb +++ b/lib/linked_in/api/companies.rb @@ -28,7 +28,7 @@ module Companies # @option options [String] :start # @return [LinkedIn::Mash] def company(options = {}) - path = company_path(options) + path = company_path(options) simple_query(path, options) end @@ -98,7 +98,7 @@ def company_updates_likes(update_key, options={}) # @return [void] def add_company_share(company_id, share) path = "/companies/#{company_id}/shares" - defaults = {:visibility => {:code => "anyone"}} + defaults = { visibility: { code: 'anyone' } } post(path, MultiJson.dump(defaults.merge(share)), "Content-Type" => "application/json") end @@ -110,7 +110,7 @@ def add_company_share(company_id, share) # @return [void] def follow_company(company_id) path = "/people/~/following/companies" - body = {:id => company_id } + body = { id: company_id } post(path, MultiJson.dump(body), "Content-Type" => "application/json") end diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index 86767583..68f7bdbb 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -3,8 +3,8 @@ module Api # People APIs # - # @see http://developer.linkedin.com/documents/people People API - # @see http://developer.linkedin.com/documents/profile-fields Profile Fields + # + # @see @see https://developer.linkedin.com/docs/fields/basic-profile Profile Fields # @see http://developer.linkedin.com/documents/field-selectors Field Selectors # @see http://developer.linkedin.com/documents/accessing-out-network-profiles Accessing Out of Network Profiles module People @@ -13,7 +13,7 @@ module People # # Permissions: r_basicprofile, r_fullprofile # - # @see http://developer.linkedin.com/documents/profile-api + # @see https://developer.linkedin.com/docs/signin-with-linkedin#content-par_componenttabbedlist_resource_1_resourceparagraph_6 # @macro person_path_options # @option options [string] :secure-urls if 'true' URLs in responses will be HTTPS # @return [LinkedIn::Mash] diff --git a/lib/linked_in/api/share_and_social_stream.rb b/lib/linked_in/api/share_and_social_stream.rb index 8ada35d6..1ba97e7e 100644 --- a/lib/linked_in/api/share_and_social_stream.rb +++ b/lib/linked_in/api/share_and_social_stream.rb @@ -3,8 +3,7 @@ module Api # Share and Social Stream APIs # - # @see http://developer.linkedin.com/documents/share-and-social-stream - # @see http://developer.linkedin.com/documents/share-api Share API + # @see https://developer.linkedin.com/docs/share-on-linkedin Share API # # The following API actions do not have corresponding methods in # this module @@ -85,7 +84,7 @@ def share_likes(update_key, options={}) # # Permissions: rw_nus # - # @see http://developer.linkedin.com/documents/share-api + # @see https://developer.linkedin.com/docs/share-on-linkedin Share API # # @macro share_input_fields # @return [void] From 99b650a33c5fc26da2ba4d5c93004fff21e06261 Mon Sep 17 00:00:00 2001 From: Abhinay Kumar Date: Thu, 28 Apr 2016 11:27:47 +0530 Subject: [PATCH 110/117] fix link in people API --- lib/linked_in/api/people.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linked_in/api/people.rb b/lib/linked_in/api/people.rb index 68f7bdbb..8f210284 100644 --- a/lib/linked_in/api/people.rb +++ b/lib/linked_in/api/people.rb @@ -4,7 +4,7 @@ module Api # People APIs # # - # @see @see https://developer.linkedin.com/docs/fields/basic-profile Profile Fields + # @see https://developer.linkedin.com/docs/fields/basic-profile Profile Fields # @see http://developer.linkedin.com/documents/field-selectors Field Selectors # @see http://developer.linkedin.com/documents/accessing-out-network-profiles Accessing Out of Network Profiles module People From 85f3136a9b409ec1547b09b2cb3975103fab2cd8 Mon Sep 17 00:00:00 2001 From: Sutanto Kurniawan Date: Mon, 25 Jul 2016 18:28:38 +0700 Subject: [PATCH 111/117] Inherit from LinkedInError --- lib/linked_in/errors.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/linked_in/errors.rb b/lib/linked_in/errors.rb index bded0658..6603eb7e 100644 --- a/lib/linked_in/errors.rb +++ b/lib/linked_in/errors.rb @@ -18,12 +18,12 @@ class GeneralError < LinkedInError; end class AccessDeniedError < LinkedInError; end # Raised when a 404 response status code is received - class NotFoundError < StandardError; end + class NotFoundError < LinkedInError; end # Raised when a 500 response status code is received - class InformLinkedInError < StandardError; end + class InformLinkedInError < LinkedInError; end # Raised when a 502 or 503 response status code is received - class UnavailableError < StandardError; end + class UnavailableError < LinkedInError; end end end From a7ecdc5049430ea766085937dd2184d267391386 Mon Sep 17 00:00:00 2001 From: phillipseymor Date: Tue, 14 Feb 2017 17:03:38 -0800 Subject: [PATCH 112/117] added shield to RapidAPI I've added a link in your README to Linkedin's functions page in RapidAPI. I've done this for a few Linkedin SDKs to help those who are reading the READMEs, understand and test the API before use. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7c1e3388..ab328ae1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). The LinkedIn gem provides an easy-to-use wrapper for LinkedIn's REST APIs. Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)](http://travis-ci.org/hexgnu/linkedin) +RapidAPI : [![API Testing](https://img.shields.io/badge/test%20this%20API%20on-RapidAPI.com-blue.svg)](https://rapidapi.com/package/LinkedIn/functions?utm_source=LinkedinGithub&utm_medium=button) ## Installation From a6a46ba3be13f8d2c315e6944daf96fbb362bfc4 Mon Sep 17 00:00:00 2001 From: Matthew Kirk Date: Thu, 9 Mar 2017 18:25:50 -0800 Subject: [PATCH 113/117] Revert "added shield to RapidAPI" This reverts commit a7ecdc5049430ea766085937dd2184d267391386. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ab328ae1..7c1e3388 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ Ruby wrapper for the [LinkedIn API](http://developer.linkedin.com). The LinkedIn gem provides an easy-to-use wrapper for LinkedIn's REST APIs. Travis CI : [![Build Status](https://secure.travis-ci.org/hexgnu/linkedin.png)](http://travis-ci.org/hexgnu/linkedin) -RapidAPI : [![API Testing](https://img.shields.io/badge/test%20this%20API%20on-RapidAPI.com-blue.svg)](https://rapidapi.com/package/LinkedIn/functions?utm_source=LinkedinGithub&utm_medium=button) ## Installation From 90e28e5254e9c2df12abd1d66a7c70cfe4cefa42 Mon Sep 17 00:00:00 2001 From: Ryan Resella Date: Wed, 8 Aug 2018 09:36:56 -0700 Subject: [PATCH 114/117] Remove rbx and add support for 2.3,2.4,2.5 --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3677baad..8bd64c6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ rvm: + - 2.5 + - 2.4 + - 2.3 - 2.0.0 - 2.1.0 - 1.9.3 - jruby-19mode - - rbx From 411250fe008afbd5e775a6722150ec211b0f96e8 Mon Sep 17 00:00:00 2001 From: Ryan Resella Date: Wed, 8 Aug 2018 09:57:49 -0700 Subject: [PATCH 115/117] Change log for OAuth2 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f76fda2..721647cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ * Re-organize modules under Api to match organization in LinkedIn's REST API documentation +## 1.1.0 - August 8, 2018 + +* Switch to OAuth2 + ## 0.4.4 - Jan 11, 2014 * Group share add From a56f5381e7d84b934c53e891b1f0421fe8a6caf9 Mon Sep 17 00:00:00 2001 From: Ryan Resella Date: Wed, 8 Aug 2018 10:34:24 -0700 Subject: [PATCH 116/117] Bump to verion 1.1.1 --- CHANGELOG.md | 2 +- lib/linked_in/version.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 721647cc..35bab969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * Re-organize modules under Api to match organization in LinkedIn's REST API documentation -## 1.1.0 - August 8, 2018 +## 1.1.1 - August 8, 2018 * Switch to OAuth2 diff --git a/lib/linked_in/version.rb b/lib/linked_in/version.rb index bbefa9d3..0c4c7b6b 100644 --- a/lib/linked_in/version.rb +++ b/lib/linked_in/version.rb @@ -2,8 +2,8 @@ module LinkedIn module VERSION #:nodoc: MAJOR = 1 - MINOR = 1 - PATCH = 0 + MINOR = 1 + PATCH = 1 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') end From 6c3535ccbec65e26d8257b4fd74cd4a0d8fe3867 Mon Sep 17 00:00:00 2001 From: Sohair Ahmad Date: Sat, 5 Oct 2019 03:53:57 +0500 Subject: [PATCH 117/117] Clarifying what is `code` --- EXAMPLES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 9acceebf..055f4015 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -20,9 +20,11 @@ client.authorize_url(:redirect_uri => 'https:://www.yourdomain.com/callback', :s => "https://api.linkedin.com/uas/oauth2/authorization?" # then fetch your access keys -client.authorize_from_request(code, :redirect_uri => 'https:://www.yourdomain.com/callback') +client.authorize_from_request(params[:code], :redirect_uri => 'https:://www.yourdomain.com/callback') => "OU812" # <= save this for future requests +NOTE: params[:code] is returned in the callback + # or authorize from previously fetched access keys client.authorize_from_access("OU812")