linkedin 0.3.7 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. data/README.markdown +1 -1
  2. data/changelog.markdown +15 -0
  3. data/lib/linked_in/api/query_methods.rb +15 -0
  4. data/lib/linked_in/api/update_methods.rb +16 -4
  5. data/lib/linked_in/helpers/authorization.rb +4 -3
  6. data/lib/linked_in/version.rb +2 -2
  7. data/linkedin.gemspec +2 -2
  8. data/spec/cases/api_spec.rb +49 -4
  9. data/spec/cases/oauth_spec.rb +13 -0
  10. data/spec/cases/search_spec.rb +35 -37
  11. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +98 -124
  12. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +120 -111
  13. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +137 -62
  14. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +64 -128
  15. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +64 -128
  16. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +39 -120
  17. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_options_with_fields.yml +26 -243
  18. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_keywords_string_parameter.yml +147 -64
  19. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option.yml +147 -62
  20. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_facets_to_return.yml +147 -62
  21. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_pagination.yml +127 -57
  22. metadata +81 -28
  23. data/spec/fixtures/cassette_library/LinkedIn_Search/_search_company/by_single_keywords_option_with_a_facet.yml +0 -111
data/README.markdown CHANGED
@@ -32,7 +32,7 @@ LinkedIn's API uses Oauth for authentication. Luckily, the LinkedIn gem hides mo
32
32
  => ["OU812", "8675309"] # <= save these for future requests
33
33
 
34
34
  # or authorize from previously fetched access keys
35
- c.authorize_from_access("OU812", "8675309")
35
+ client.authorize_from_access("OU812", "8675309")
36
36
 
37
37
  # you're now free to move about the cabin, call any API method
38
38
 
data/changelog.markdown CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 - May 30, 2013
4
+
5
+ * Add capability to ask for desired permissions from linked in api
6
+ * Add option to specify a proxy
7
+ * Bump hashie version
8
+ * fix the permission param passing
9
+ * fix to be able to pass the permission scope
10
+ * Manipulating comments/likes for network_updates ('shares')
11
+ * Methods to work with comments/likes for share
12
+ * Added a method to get a user's shares
13
+ * Added current user's shares as an option (client.shares)
14
+ * Readme Typos
15
+
16
+
17
+
3
18
  ## 0.2.x - March x, 2010
4
19
 
5
20
  * Removed Crack as a dependency, Nokogiri FTW
@@ -27,6 +27,21 @@ module LinkedIn
27
27
  path = "#{person_path(options)}/group-memberships"
28
28
  simple_query(path, options)
29
29
  end
30
+
31
+ def shares(options={})
32
+ path = "#{person_path(options)}/network/updates?type=SHAR&scope=self"
33
+ simple_query(path, options)
34
+ end
35
+
36
+ def share_comments(update_key, options={})
37
+ path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments"
38
+ simple_query(path, options)
39
+ end
40
+
41
+ def share_likes(update_key, options={})
42
+ path = "#{person_path(options)}/network/updates/key=#{update_key}/likes"
43
+ simple_query(path, options)
44
+ end
30
45
 
31
46
  private
32
47
 
@@ -21,16 +21,28 @@ module LinkedIn
21
21
  # post(path, share_to_xml(defaults.merge(options)))
22
22
  # end
23
23
  #
24
- # def update_comment(network_key, comment)
25
- # path = "/people/~/network/updates/key=#{network_key}/update-comments"
26
- # post(path, comment_to_xml(comment))
27
- # end
24
+ def update_comment(network_key, comment)
25
+ path = "/people/~/network/updates/key=#{network_key}/update-comments"
26
+ body = {'comment' => comment}
27
+ post(path, body.to_json, "Content-Type" => "application/json")
28
+ end
28
29
  #
29
30
  # def update_network(message)
30
31
  # path = "/people/~/person-activities"
31
32
  # post(path, network_update_to_xml(message))
32
33
  # end
33
34
  #
35
+
36
+ def like_share(network_key)
37
+ path = "/people/~/network/updates/key=#{network_key}/is-liked"
38
+ put(path, 'true', "Content-Type" => "application/json")
39
+ end
40
+
41
+ def unlike_share(network_key)
42
+ path = "/people/~/network/updates/key=#{network_key}/is-liked"
43
+ put(path, 'false', "Content-Type" => "application/json")
44
+ end
45
+
34
46
  def send_message(subject, body, recipient_paths)
35
47
  path = "/people/~/mailbox"
36
48
 
@@ -18,8 +18,8 @@ module LinkedIn
18
18
  # Note: If using oauth with a web app, be sure to provide :oauth_callback.
19
19
  # Options:
20
20
  # :oauth_callback => String, url that LinkedIn should redirect to
21
- def request_token(options={})
22
- @request_token ||= consumer.get_request_token(options)
21
+ def request_token(options={}, *arguments, &block)
22
+ @request_token ||= consumer.get_request_token(options, *arguments, &block)
23
23
  end
24
24
 
25
25
  # For web apps use params[:oauth_verifier], for desktop apps,
@@ -48,7 +48,8 @@ module LinkedIn
48
48
  :request_token_url => full_oauth_url_for(:request_token, :api_host),
49
49
  :access_token_url => full_oauth_url_for(:access_token, :api_host),
50
50
  :authorize_url => full_oauth_url_for(:authorize, :auth_host),
51
- :site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host]
51
+ :site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host],
52
+ :proxy => @consumer_options.fetch(:proxy, nil)
52
53
  }
53
54
  end
54
55
 
@@ -2,8 +2,8 @@ module LinkedIn
2
2
 
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
- MINOR = 3
6
- PATCH = 7
5
+ MINOR = 4
6
+ PATCH = 0
7
7
  PRE = nil
8
8
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
9
9
  end
data/linkedin.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  require File.expand_path('../lib/linked_in/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.add_dependency 'hashie', '~> 1.2'
5
+ gem.add_dependency 'hashie', ['>= 1.2', '< 2.1']
6
6
  gem.add_dependency 'multi_json', '~> 1.0'
7
7
  gem.add_dependency 'oauth', '~> 0.4'
8
8
  gem.add_development_dependency 'json', '~> 1.6'
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.add_development_dependency 'rspec', '~> 2.6'
12
12
  gem.add_development_dependency 'simplecov', '~> 0.5'
13
13
  gem.add_development_dependency 'vcr', '~> 1.10'
14
- gem.add_development_dependency 'webmock', '~> 1.7'
14
+ gem.add_development_dependency 'webmock', '~> 1.9'
15
15
  gem.authors = ["Wynn Netherland", "Josh Kalderimis"]
16
16
  gem.description = %q{Ruby wrapper for the LinkedIn API}
17
17
  gem.email = ['wynn.netherland@gmail.com', 'josh.kalderimis@gmail.com']
@@ -30,6 +30,16 @@ describe LinkedIn::Api do
30
30
  client.network_updates.should be_an_instance_of(LinkedIn::Mash)
31
31
  end
32
32
 
33
+ it "should be able to view network_update's comments" do
34
+ stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/update-comments").to_return(:body => "{}")
35
+ client.share_comments("network_update_key").should be_an_instance_of(LinkedIn::Mash)
36
+ end
37
+
38
+ it "should be able to view network_update's likes" do
39
+ stub_request(:get, "https://api.linkedin.com/v1/people/~/network/updates/key=network_update_key/likes").to_return(:body => "{}")
40
+ client.share_likes("network_update_key").should be_an_instance_of(LinkedIn::Mash)
41
+ end
42
+
33
43
  it "should be able to search with a keyword if given a String" do
34
44
  stub_request(:get, "https://api.linkedin.com/v1/people-search?keywords=business").to_return(:body => "{}")
35
45
  client.search("business").should be_an_instance_of(LinkedIn::Mash)
@@ -41,24 +51,59 @@ describe LinkedIn::Api do
41
51
  end
42
52
 
43
53
  it "should be able to search with an option and fetch specific fields" do
44
- stub_request(:get, "https://api.linkedin.com/v1/people-search:(num-results,total)?first-name=Javan").to_return(:body => "{}")
54
+ stub_request(:get, "https://api.linkedin.com/v1/people-search:(num-results,total)?first-name=Javan").to_return(
55
+ :body => "{}")
45
56
  client.search(:first_name => "Javan", :fields => ["num_results", "total"]).should be_an_instance_of(LinkedIn::Mash)
46
57
  end
47
58
 
48
59
  it "should be able to share a new status" do
49
60
  stub_request(:post, "https://api.linkedin.com/v1/people/~/shares").to_return(:body => "", :status => 201)
50
61
  response = client.add_share(:comment => "Testing, 1, 2, 3")
51
- response.body.should == ""
62
+ response.body.should == nil
63
+ response.code.should == "201"
64
+ end
65
+
66
+ it "should be able to comment on network update" do
67
+ stub_request(:post, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/update-comments").to_return(
68
+ :body => "", :status => 201)
69
+ response = client.update_comment('SOMEKEY', "Testing, 1, 2, 3")
70
+ response.body.should == nil
52
71
  response.code.should == "201"
53
72
  end
54
73
 
55
74
  it "should be able to send a message" do
56
75
  stub_request(:post, "https://api.linkedin.com/v1/people/~/mailbox").to_return(:body => "", :status => 201)
57
76
  response = client.send_message("subject", "body", ["recip1", "recip2"])
58
- response.body.should == ""
77
+ response.body.should == nil
78
+ response.code.should == "201"
79
+ end
80
+
81
+ it "should be able to like a network update" do
82
+ stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked").
83
+ with(:body => "true").to_return(:body => "", :status => 201)
84
+ response = client.like_share('SOMEKEY')
85
+ response.body.should == nil
86
+ response.code.should == "201"
87
+ end
88
+
89
+ it "should be able to unlike a network update" do
90
+ stub_request(:put, "https://api.linkedin.com/v1/people/~/network/updates/key=SOMEKEY/is-liked").
91
+ with(:body => "false").to_return(:body => "", :status => 201)
92
+ response = client.unlike_share('SOMEKEY')
93
+ response.body.should == nil
59
94
  response.code.should == "201"
60
95
  end
61
96
 
97
+ it "should be able to pass down the additional arguments to OAuth's get_request_token" do
98
+ consumer.should_receive(:get_request_token).with(
99
+ {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus").and_return("request_token")
100
+
101
+ request_token = client.request_token(
102
+ {:oauth_callback => "http://localhost:3000/auth/callback"}, :scope => "rw_nus"
103
+ )
104
+
105
+ request_token.should == "request_token"
106
+ end
62
107
 
63
108
  context "Company API" do
64
109
  use_vcr_cassette
@@ -102,7 +147,7 @@ describe LinkedIn::Api do
102
147
  stub_request(:put, "https://api.linkedin.com/v1/people/~/group-memberships/123").to_return(:body => "", :status => 201)
103
148
 
104
149
  response = client.join_group(123)
105
- response.body.should == ""
150
+ response.body.should == nil
106
151
  response.code.should == "201"
107
152
  end
108
153
 
@@ -20,6 +20,19 @@ describe "LinkedIn::Client" do
20
20
  end
21
21
  end
22
22
 
23
+ describe "proxy oauth options" do
24
+ let(:proxy) { "http://dummy.proxy" }
25
+ let(:consumer) do
26
+ LinkedIn::Client.new('1234', '1234', {
27
+ :proxy => proxy,
28
+ }).consumer
29
+ end
30
+
31
+ it "should send requests though proxy" do
32
+ consumer.proxy.should eq proxy
33
+ end
34
+ end
35
+
23
36
  describe "different api and auth hosts options" do
24
37
  let(:consumer) do
25
38
  LinkedIn::Client.new('1234', '1234', {
@@ -70,10 +70,10 @@ describe LinkedIn::Search do
70
70
 
71
71
  it "should perform a search" do
72
72
  results.companies.all.size.should == 5
73
- results.companies.all.first.name.should == 'Apple Vacations'
74
- results.companies.all.first.id.should == 19271
75
- results.companies.all.last.name.should == 'Micro Center'
76
- results.companies.all.last.id.should == 15552
73
+ results.companies.all.first.name.should == 'iSquare - Apple Authorized Distributor in Greece & Cyprus'
74
+ results.companies.all.first.id.should == 2135525
75
+ results.companies.all.last.name.should == 'Apple Crumble'
76
+ results.companies.all.last.id.should == 1049054
77
77
  end
78
78
  end
79
79
 
@@ -87,7 +87,7 @@ describe LinkedIn::Search do
87
87
 
88
88
  it "should perform a search" do
89
89
  results.companies.all.first.name.should == 'Apple'
90
- 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.'
90
+ 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.'
91
91
  results.companies.all.first.id.should == 162479
92
92
  end
93
93
  end
@@ -104,10 +104,10 @@ describe LinkedIn::Search do
104
104
  end
105
105
 
106
106
  it "should perform a search" do
107
- results.people.all.size.should == 10
108
- results.people.all.first.first_name.should == 'Giliardi'
109
- results.people.all.first.last_name.should == 'Pires'
110
- results.people.all.first.id.should == 'YkdnFl04s_'
107
+ results.people.all.size.should == 6
108
+ results.people.all.first.first_name.should == 'Shay'
109
+ results.people.all.first.last_name.should == 'Frendt'
110
+ results.people.all.first.id.should == 'ucXjUw4M9J'
111
111
  end
112
112
  end
113
113
 
@@ -119,10 +119,10 @@ describe LinkedIn::Search do
119
119
  end
120
120
 
121
121
  it "should perform a search" do
122
- results.people.all.size.should == 10
123
- results.people.all.first.first_name.should == 'Giliardi'
124
- results.people.all.first.last_name.should == 'Pires'
125
- results.people.all.first.id.should == 'YkdnFl04s_'
122
+ results.people.all.size.should == 6
123
+ results.people.all.first.first_name.should == 'Shay'
124
+ results.people.all.first.last_name.should == 'Frendt'
125
+ results.people.all.first.id.should == 'ucXjUw4M9J'
126
126
  end
127
127
  end
128
128
 
@@ -134,13 +134,10 @@ describe LinkedIn::Search do
134
134
  end
135
135
 
136
136
  it "should perform a search" do
137
- results.people.all.size.should == 5
138
- results.people.all.first.first_name.should == 'Stephen'
139
- results.people.all.first.last_name.should == 'M.'
140
- results.people.all.first.id.should == 'z2XMcxa_dR'
141
- results.people.all.last.first_name.should == 'Pablo'
142
- results.people.all.last.last_name.should == 'C.'
143
- results.people.all.last.id.should == 'pdzrGpyP0h'
137
+ results.people.all.size.should == 1
138
+ results.people.all.first.first_name.should == 'Satish'
139
+ results.people.all.first.last_name.should == 'Talim'
140
+ results.people.all.first.id.should == 'V1FPuGot-I'
144
141
  end
145
142
  end
146
143
 
@@ -148,14 +145,14 @@ describe LinkedIn::Search do
148
145
  use_vcr_cassette :record => :new_episodes
149
146
 
150
147
  let(:results) do
151
- client.search(:first_name => 'Giliardi', :last_name => 'Pires')
148
+ client.search(:first_name => 'Charles', :last_name => 'Garcia')
152
149
  end
153
150
 
154
151
  it "should perform a search" do
155
- results.people.all.size.should == 1
156
- results.people.all.first.first_name.should == 'Giliardi'
157
- results.people.all.first.last_name.should == 'Pires'
158
- results.people.all.first.id.should == 'YkdnFl04s_'
152
+ results.people.all.size.should == 10
153
+ results.people.all.first.first_name.should == 'Charles'
154
+ results.people.all.first.last_name.should == 'Garcia, CFA'
155
+ results.people.all.first.id.should == '2zk34r8TvA'
159
156
  end
160
157
  end
161
158
 
@@ -164,16 +161,17 @@ describe LinkedIn::Search do
164
161
 
165
162
  let(:results) do
166
163
  fields = [{:people => [:id, :first_name, :last_name, :public_profile_url, :picture_url]}, :num_results]
167
- client.search(:first_name => 'Giliardi', :last_name => 'Pires', :fields => fields)
164
+ client.search(:first_name => 'Charles', :last_name => 'Garcia', :fields => fields)
168
165
  end
169
166
 
170
167
  it "should perform a search" do
171
- results.people.all.size.should == 1
172
- results.people.all.first.first_name.should == 'Giliardi'
173
- results.people.all.first.last_name.should == 'Pires'
174
- results.people.all.first.id.should == 'YkdnFl04s_'
175
- results.people.all.first.picture_url == 'http://media.linkedin.com/mpr/mprx/0_Oz05kn9xkWziAEOUKtOVkqzjXd8Clf7UyqIVkqchR2NtmwZRt1fWoN_aobhg-HmB09jUwPLKrAhU'
176
- results.people.all.first.public_profile_url == 'http://www.linkedin.com/in/gibanet'
168
+ first_person = results.people.all.first
169
+ results.people.all.size.should == 10
170
+ first_person.first_name.should == 'Charles'
171
+ first_person.last_name.should == 'Garcia, CFA'
172
+ first_person.id.should == '2zk34r8TvA'
173
+ first_person.picture_url.should be_nil
174
+ first_person.public_profile_url.should == 'http://www.linkedin.com/in/charlesgarcia'
177
175
  end
178
176
  end
179
177
 
@@ -181,14 +179,14 @@ describe LinkedIn::Search do
181
179
  use_vcr_cassette :record => :new_episodes
182
180
 
183
181
  let(:results) do
184
- client.search(:company_name => 'linkedin')
182
+ client.search(:company_name => 'IBM')
185
183
  end
186
184
 
187
185
  it "should perform a search" do
188
- results.people.all.size.should == 10
189
- results.people.all.first.first_name.should == 'Donald'
190
- results.people.all.first.last_name.should == 'Denker'
191
- results.people.all.first.id.should == 'VQcsz5Hp_h'
186
+ results.people.all.size.should == 6
187
+ results.people.all.first.first_name.should == 'Ryan'
188
+ results.people.all.first.last_name.should == 'Sue'
189
+ results.people.all.first.id.should == 'KHkgwBMaa-'
192
190
  end
193
191
  end
194
192
 
@@ -1,135 +1,109 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
4
  method: :get
5
5
  uri: https://api.linkedin.com:443/v1/people-search?company-name=linkedin
6
6
  body:
7
- headers:
8
- user-agent:
9
- - OAuth gem v0.4.4
10
- authorization:
11
- - OAuth oauth_consumer_key="C2UfeHxZrij1PyppziDLbdUQti6f4TLaL-N0dyiV_us4Pj18_vsHcjKIX0i69fSn",
12
- oauth_nonce="5DbPHhxweU6eNBPoAJqkobtxNsZDDIgtmfF0sx3rmQE", oauth_signature="DkRDger8eQvtJq1i8%2FjHzrNAFis%3D",
13
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061368", oauth_token="afb39322-be32-4b83-83a0-7e35e18d3082",
14
- oauth_version="1.0"
15
- x-li-format:
7
+ headers:
8
+ user-agent:
9
+ - OAuth gem v0.4.7
10
+ authorization:
11
+ - 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"
12
+ x-li-format:
16
13
  - json
17
- response: !ruby/struct:VCR::Response
18
- status: !ruby/struct:VCR::ResponseStatus
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
19
16
  code: 200
20
17
  message: OK
21
- headers:
22
- content-type:
23
- - application/json;charset=UTF-8
24
- server:
25
- - Apache-Coyote/1.1
26
- date:
27
- - Tue, 10 May 2011 21:02:49 GMT
28
- x-li-format:
29
- - json
30
- vary:
31
- - x-li-format,Accept-Encoding
32
- transfer-encoding:
18
+ headers:
19
+ x-li-request-id:
20
+ - 0UF1FY9HHN
21
+ vary:
22
+ - "*"
23
+ transfer-encoding:
33
24
  - chunked
34
- body: ! "{\n \"numResults\": 5228,\n \"people\": {\n \"values\": [\n {\n
35
- \ \"id\": \"VQcsz5Hp_h\",\n \"lastName\": \"Denker\",\n \"firstName\":
36
- \"Donald\"\n },\n {\n \"id\": \"YEDghC612B\",\n \"lastName\":
37
- \"S.\",\n \"firstName\": \"Daniel\"\n },\n {\n \"id\":
38
- \"KMioNXVEg9\",\n \"lastName\": \"H.\",\n \"firstName\": \"Reid\"\n
39
- \ },\n {\n \"id\": \"ILGTOKmto4\",\n \"lastName\": \"Ruff\",\n
40
- \ \"firstName\": \"Lori\"\n },\n {\n \"id\": \"xr5jcMXKPm\",\n
41
- \ \"lastName\": \"C.\",\n \"firstName\": \"Ed\"\n },\n {\n
42
- \ \"id\": \"aeejoSqHsN\",\n \"lastName\": \"T.\",\n \"firstName\":
43
- \"Brian\"\n },\n {\n \"id\": \"VYC0P9hxVN\",\n \"lastName\":
44
- \"Giffen\",\n \"firstName\": \"Sean\"\n },\n {\n \"id\":
45
- \"kWPJPI1lrJ\",\n \"lastName\": \"Seps\",\n \"firstName\": \"Chad\"\n
46
- \ },\n {\n \"id\": \"1PYJr69P5V\",\n \"lastName\": \"Vasconcelos\",\n
47
- \ \"firstName\": \"Cesar\"\n },\n {\n \"id\": \"AU5Dv63Fma\",\n
48
- \ \"lastName\": \"Ling\",\n \"firstName\": \"James\"\n }\n
49
- \ ],\n \"_count\": 10,\n \"_start\": 0,\n \"_total\": 110\n }\n}"
50
- http_version: '1.1'
51
- - !ruby/struct:VCR::HTTPInteraction
52
- request: !ruby/struct:VCR::Request
53
- method: :post
54
- uri: https://api.linkedin.com:443/uas/oauth/requestToken
55
- body:
56
- headers:
57
- user-agent:
58
- - OAuth gem v0.4.5
59
- content-length:
60
- - '0'
61
- authorization:
62
- - OAuth oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_callback="oob",
63
- oauth_consumer_key="a39e395e-bc38-4d5b-ae3b-52f840f821e9", oauth_nonce="jCUtbvZXpwNVfrj2x0XmxFfQD55R4NoJqVnhgjKEno",
64
- oauth_signature="8XiRWCIiDK%2Fwr%2FTLttRDPnsFaiE%3D", oauth_signature_method="HMAC-SHA1",
65
- oauth_timestamp="1329922227", oauth_version="1.0"
66
- response: !ruby/struct:VCR::Response
67
- status: !ruby/struct:VCR::ResponseStatus
68
- code: 401
69
- message: Unauthorized
70
- headers:
71
- server:
25
+ server:
72
26
  - Apache-Coyote/1.1
73
- www-authenticate:
74
- - OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="consumer_key_unknown"
75
- content-type:
76
- - application/x-www-form-urlencoded;charset=UTF-8
77
- content-length:
78
- - '34'
79
- vary:
80
- - Accept-Encoding
81
- date:
82
- - Wed, 22 Feb 2012 14:50:29 GMT
83
- body: oauth_problem=consumer_key_unknown
84
- http_version: '1.1'
85
- - !ruby/struct:VCR::HTTPInteraction
86
- request: !ruby/struct:VCR::Request
27
+ content-type:
28
+ - application/json;charset=UTF-8
29
+ date:
30
+ - Wed, 10 Apr 2013 22:07:36 GMT
31
+ x-li-format:
32
+ - json
33
+ body: |-
34
+ {
35
+ "numResults": 0,
36
+ "people": {"_total": 0}
37
+ }
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
87
41
  method: :get
88
- uri: https://api.linkedin.com:443/v1people-search?company-name=linkedin
42
+ uri: https://api.linkedin.com:443/v1/people-search?company-name=IBM
89
43
  body:
90
- headers:
91
- x-li-format:
44
+ headers:
45
+ user-agent:
46
+ - OAuth gem v0.4.7
47
+ authorization:
48
+ - 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"
49
+ x-li-format:
92
50
  - json
93
- user-agent:
94
- - OAuth gem v0.4.5
95
- authorization:
96
- - OAuth oauth_consumer_key="n22cs9eyo36s", oauth_nonce="5oBn6Ns1YZXUeh0oEmAcCjQrXFhf6c652LEGbFbYe4",
97
- oauth_signature="yHtXFEkeWfhnrsEpDaXn2Epv9KY%3D", oauth_signature_method="HMAC-SHA1",
98
- oauth_timestamp="1329991237", oauth_token="a39e395e-bc38-4d5b-ae3b-52f840f821e9",
99
- oauth_version="1.0"
100
- response: !ruby/struct:VCR::Response
101
- status: !ruby/struct:VCR::ResponseStatus
102
- code: 404
103
- message: Not Found
104
- headers:
105
- content-type:
106
- - text/html
107
- content-length:
108
- - '1888'
109
- date:
110
- - Thu, 23 Feb 2012 10:00:38 GMT
111
- server:
112
- - lighttpd
113
- body: ! "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n
114
- \ <title>404: Page Not Found</title>\n <meta http-equiv=\"content-type\" content=\"text/html;
115
- charset=UTF-8\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/style.css\">\n</head>\n\n<body
116
- class=\"errorpg\">\n\n<div id=\"header\">\n <a href=\"/home\"><img src=\"/img/logos/logo.gif\"
117
- width=\"129\" height=\"36\" alt=\"Linkedin\"></a>\n</div>\n\n<div id=\"main\"
118
- class=\"error404\">\n <h1>Page Not Found</h1>\n <p>The page you requested
119
- is no longer available, or cannot be found.</p>\n <p class=\"bottom\">Please
120
- double-check the URL (address) you used, or <a href=\"mailto:customer_service@linkedin.com\">contact
121
- us</a> if you feel you have reached this page in error.</p>\n <p class=\"top
122
- helper\"><strong>Click the &#8220;Back&#8221; button on your browser or <a href=\"/home\">go
123
- to the home page</a>.</strong></p>\n \n <br>\n \n <p><strong>Are you looking
124
- for any of these LinkedIn features?</strong></p>\n <ul>\n <li><a href=\"/search\">Find
125
- People</a></li>\n <li><a href=\"/jobs\">Find Jobs</a></li>\n <li><a href=\"/services\">Find
126
- Services</a></li>\n <li><a href=\"/reconnect?displayCategories=\">Reconnect
127
- with Colleagues</a></li>\n </ul>\n \n <ul>\n <li><a href=\"/static?key=outlook_toolbar_download\">Outlook
128
- Toolbar</a></li>\n <li><a href=\"/static?key=firefox_companion_download\">Firefox
129
- Companion</a></li>\n <li><a href=\"/static?key=ie_toolbar_download\">Internet
130
- Explorer Toolbar</a></li>\n <li><a href=\"/static?key=groups_info\">LinkedIn
131
- for Groups</a></li>\n </ul>\n\n <ul>\n <li><a href=\"https://www.linkedin.com/secure/settings\">My
132
- Account</a></li>\n <li><a href=\"/profile\">My Profile</a></li>\n <li><a
133
- href=\"/connections\">My Connections</a></li>\n <li><a href=\"/inviteMany\">Add
134
- Connections</a></li>\n </ul>\n <div class=\"spacer\">&nbsp;</div>\n</div>\n\n</body>\n</html>"
135
- http_version: '1.1'
51
+ response: !ruby/struct:VCR::Response
52
+ status: !ruby/struct:VCR::ResponseStatus
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ x-li-request-id:
57
+ - L00YMW359U
58
+ vary:
59
+ - "*"
60
+ transfer-encoding:
61
+ - chunked
62
+ server:
63
+ - Apache-Coyote/1.1
64
+ date:
65
+ - Wed, 10 Apr 2013 22:09:58 GMT
66
+ x-li-format:
67
+ - json
68
+ content-type:
69
+ - application/json;charset=UTF-8
70
+ body: |-
71
+ {
72
+ "numResults": 6,
73
+ "people": {
74
+ "_total": 6,
75
+ "values": [
76
+ {
77
+ "firstName": "Ryan",
78
+ "id": "KHkgwBMaa-",
79
+ "lastName": "Sue"
80
+ },
81
+ {
82
+ "firstName": "Ben",
83
+ "id": "lljISRB-WQ",
84
+ "lastName": "Mejia"
85
+ },
86
+ {
87
+ "firstName": "James",
88
+ "id": "zLwxyfa2cv",
89
+ "lastName": "Stevenson"
90
+ },
91
+ {
92
+ "firstName": "Charles",
93
+ "id": "r5Kzi9Um-e",
94
+ "lastName": "Kafoglis"
95
+ },
96
+ {
97
+ "firstName": "Sauraj",
98
+ "id": "RLJu6NhdI2",
99
+ "lastName": "Goswami"
100
+ },
101
+ {
102
+ "firstName": "Jonathan",
103
+ "id": "NgAxaSCyZ3",
104
+ "lastName": "Hedstrom"
105
+ }
106
+ ]
107
+ }
108
+ }
109
+ http_version: "1.1"