crankin 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.autotest +14 -0
- data/.document +5 -0
- data/.gemtest +0 -0
- data/.gitignore +41 -0
- data/.rspec +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +7 -0
- data/LICENSE +20 -0
- data/README.markdown +78 -0
- data/Rakefile +19 -0
- data/changelog.markdown +71 -0
- data/examples/authenticate.rb +21 -0
- data/examples/network.rb +12 -0
- data/examples/profile.rb +18 -0
- data/examples/sinatra.rb +82 -0
- data/examples/status.rb +9 -0
- data/lib/linked_in/api/query_methods.rb +101 -0
- data/lib/linked_in/api/update_methods.rb +82 -0
- data/lib/linked_in/api.rb +6 -0
- data/lib/linked_in/client.rb +46 -0
- data/lib/linked_in/errors.rb +18 -0
- data/lib/linked_in/helpers/authorization.rb +68 -0
- data/lib/linked_in/helpers/request.rb +78 -0
- data/lib/linked_in/helpers.rb +6 -0
- data/lib/linked_in/mash.rb +68 -0
- data/lib/linked_in/search.rb +56 -0
- data/lib/linked_in/version.rb +11 -0
- data/lib/linkedin.rb +32 -0
- data/linkedin.gemspec +25 -0
- data/spec/cases/api_spec.rb +86 -0
- data/spec/cases/linkedin_spec.rb +37 -0
- data/spec/cases/mash_spec.rb +85 -0
- data/spec/cases/oauth_spec.rb +166 -0
- data/spec/cases/search_spec.rb +127 -0
- data/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml +73 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +28 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +92 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +43 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +45 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +92 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +92 -0
- data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +67 -0
- data/spec/helper.rb +30 -0
- metadata +205 -0
@@ -0,0 +1,166 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe "LinkedIn::Client" do
|
4
|
+
|
5
|
+
let(:client) do
|
6
|
+
key = ENV['LINKED_IN_CONSUMER_KEY'] || '1234'
|
7
|
+
secret = ENV['LINKED_IN_CONSUMER_SECRET'] || '1234'
|
8
|
+
LinkedIn::Client.new(key, secret)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#consumer" do
|
12
|
+
describe "default oauth options" do
|
13
|
+
let(:consumer) { client.consumer }
|
14
|
+
|
15
|
+
it "should return a configured OAuth consumer" do
|
16
|
+
consumer.site.should == 'https://api.linkedin.com'
|
17
|
+
consumer.request_token_url.should == 'https://api.linkedin.com/uas/oauth/requestToken'
|
18
|
+
consumer.access_token_url.should == 'https://api.linkedin.com/uas/oauth/accessToken'
|
19
|
+
consumer.authorize_url.should == 'https://www.linkedin.com/uas/oauth/authorize'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "different api and auth hosts options" do
|
24
|
+
let(:consumer) do
|
25
|
+
LinkedIn::Client.new('1234', '1234', {
|
26
|
+
:api_host => 'https://api.josh.com',
|
27
|
+
:auth_host => 'https://www.josh.com'
|
28
|
+
}).consumer
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should return a configured OAuth consumer" do
|
32
|
+
consumer.site.should == 'https://api.josh.com'
|
33
|
+
consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken'
|
34
|
+
consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken'
|
35
|
+
consumer.authorize_url.should == 'https://www.josh.com/uas/oauth/authorize'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "different oauth paths" do
|
40
|
+
let(:consumer) do
|
41
|
+
LinkedIn::Client.new('1234', '1234', {
|
42
|
+
:request_token_path => "/secure/oauth/requestToken",
|
43
|
+
:access_token_path => "/secure/oauth/accessToken",
|
44
|
+
:authorize_path => "/secure/oauth/authorize",
|
45
|
+
}).consumer
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should return a configured OAuth consumer" do
|
49
|
+
consumer.site.should == 'https://api.linkedin.com'
|
50
|
+
consumer.request_token_url.should == 'https://api.linkedin.com/secure/oauth/requestToken'
|
51
|
+
consumer.access_token_url.should == 'https://api.linkedin.com/secure/oauth/accessToken'
|
52
|
+
consumer.authorize_url.should == 'https://www.linkedin.com/secure/oauth/authorize'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "specify oauth urls" do
|
57
|
+
let(:consumer) do
|
58
|
+
LinkedIn::Client.new('1234', '1234', {
|
59
|
+
:request_token_url => "https://api.josh.com/secure/oauth/requestToken",
|
60
|
+
:access_token_url => "https://api.josh.com/secure/oauth/accessToken",
|
61
|
+
:authorize_url => "https://www.josh.com/secure/oauth/authorize",
|
62
|
+
}).consumer
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should return a configured OAuth consumer" do
|
66
|
+
consumer.site.should == 'https://api.linkedin.com'
|
67
|
+
consumer.request_token_url.should == 'https://api.josh.com/secure/oauth/requestToken'
|
68
|
+
consumer.access_token_url.should == 'https://api.josh.com/secure/oauth/accessToken'
|
69
|
+
consumer.authorize_url.should == 'https://www.josh.com/secure/oauth/authorize'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "use the :site option to specify the host of all oauth urls" do
|
74
|
+
let(:consumer) do
|
75
|
+
LinkedIn::Client.new('1234', '1234', {
|
76
|
+
:site => "https://api.josh.com"
|
77
|
+
}).consumer
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should return a configured OAuth consumer" do
|
81
|
+
consumer.site.should == 'https://api.josh.com'
|
82
|
+
consumer.request_token_url.should == 'https://api.josh.com/uas/oauth/requestToken'
|
83
|
+
consumer.access_token_url.should == 'https://api.josh.com/uas/oauth/accessToken'
|
84
|
+
consumer.authorize_url.should == 'https://api.josh.com/uas/oauth/authorize'
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe "#request_token" do
|
90
|
+
describe "with default options" do
|
91
|
+
use_vcr_cassette :record => :new_episodes
|
92
|
+
|
93
|
+
it "should return a valid request token" do
|
94
|
+
request_token = client.request_token
|
95
|
+
|
96
|
+
request_token.should be_a_kind_of OAuth::RequestToken
|
97
|
+
request_token.authorize_url.should include("https://www.linkedin.com/uas/oauth/authorize?oauth_token=")
|
98
|
+
|
99
|
+
a_request(:post, "https://api.linkedin.com/uas/oauth/requestToken").should have_been_made.once
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "with a callback url" do
|
104
|
+
use_vcr_cassette :record => :new_episodes
|
105
|
+
|
106
|
+
it "should return a valid access token" do
|
107
|
+
request_token = client.request_token(:oauth_callback => 'http://www.josh.com')
|
108
|
+
|
109
|
+
request_token.should be_a_kind_of OAuth::RequestToken
|
110
|
+
request_token.authorize_url.should include("https://www.linkedin.com/uas/oauth/authorize?oauth_token=")
|
111
|
+
request_token.callback_confirmed?.should == true
|
112
|
+
|
113
|
+
a_request(:post, "https://api.linkedin.com/uas/oauth/requestToken").should have_been_made.once
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "#authorize_from_request" do
|
119
|
+
let(:access_token) do
|
120
|
+
# if you remove the related casssette you will need to do the following
|
121
|
+
# authorize_from_request request manually
|
122
|
+
#
|
123
|
+
# request_token = client.request_token
|
124
|
+
# puts "token : #{request_token.token} - secret #{request_token.secret}"
|
125
|
+
# puts "auth url : #{request_token.authorize_url}"
|
126
|
+
# raise 'keep note of the token and secret'
|
127
|
+
#
|
128
|
+
client.authorize_from_request('dummy-token', 'dummy-secret', 'dummy-pin')
|
129
|
+
end
|
130
|
+
|
131
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method]
|
132
|
+
|
133
|
+
it "should return a valid access token" do
|
134
|
+
access_token.should be_a_kind_of Array
|
135
|
+
access_token[0].should be_a_kind_of String
|
136
|
+
access_token[1].should be_a_kind_of String
|
137
|
+
|
138
|
+
a_request(:post, "https://api.linkedin.com/uas/oauth/accessToken").should have_been_made.once
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe "#access_token" do
|
143
|
+
let(:access_token) do
|
144
|
+
client.authorize_from_access('dummy-token', 'dummy-secret')
|
145
|
+
client.access_token
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should return a valid auth token" do
|
149
|
+
access_token.should be_a_kind_of OAuth::AccessToken
|
150
|
+
access_token.token.should be_a_kind_of String
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
describe "#authorize_from_access" do
|
155
|
+
let(:auth_token) do
|
156
|
+
client.authorize_from_access('dummy-token', 'dummy-secret')
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should return a valid auth token" do
|
160
|
+
auth_token.should be_a_kind_of Array
|
161
|
+
auth_token[0].should be_a_kind_of String
|
162
|
+
auth_token[1].should be_a_kind_of String
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe LinkedIn::Search do
|
4
|
+
|
5
|
+
# if you remove the related cassettes you will need to inform valid
|
6
|
+
# tokens and secrets to regenerate them
|
7
|
+
#
|
8
|
+
let(:client) do
|
9
|
+
consumer_token = ENV['LINKED_IN_CONSUMER_KEY'] || 'key'
|
10
|
+
consumer_secret = ENV['LINKED_IN_CONSUMER_SECRET'] || 'secret'
|
11
|
+
client = LinkedIn::Client.new(consumer_token, consumer_secret)
|
12
|
+
auth_token = ENV['LINKED_IN_AUTH_KEY'] || 'key'
|
13
|
+
auth_secret = ENV['LINKED_IN_AUTH_SECRET'] || 'secret'
|
14
|
+
client.authorize_from_access(auth_token, auth_secret)
|
15
|
+
client
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#search" do
|
19
|
+
|
20
|
+
describe "by keywords string parameter" do
|
21
|
+
use_vcr_cassette :record => :new_episodes
|
22
|
+
|
23
|
+
let(:results) do
|
24
|
+
client.search('github')
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should perform a search" do
|
28
|
+
results.people.all.size.should == 10
|
29
|
+
results.people.all.first.first_name.should == 'Giliardi'
|
30
|
+
results.people.all.first.last_name.should == 'Pires'
|
31
|
+
results.people.all.first.id.should == 'YkdnFl04s_'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "by single keywords option" do
|
36
|
+
use_vcr_cassette :record => :new_episodes
|
37
|
+
|
38
|
+
let(:results) do
|
39
|
+
client.search(:keywords => 'github')
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should perform a search" do
|
43
|
+
results.people.all.size.should == 10
|
44
|
+
results.people.all.first.first_name.should == 'Giliardi'
|
45
|
+
results.people.all.first.last_name.should == 'Pires'
|
46
|
+
results.people.all.first.id.should == 'YkdnFl04s_'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "by single keywords option with pagination" do
|
51
|
+
use_vcr_cassette :record => :new_episodes
|
52
|
+
|
53
|
+
let(:results) do
|
54
|
+
client.search(:keywords => 'github', :start => 5, :count => 5)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should perform a search" do
|
58
|
+
results.people.all.size.should == 5
|
59
|
+
results.people.all.first.first_name.should == 'Stephen'
|
60
|
+
results.people.all.first.last_name.should == 'M.'
|
61
|
+
results.people.all.first.id.should == 'z2XMcxa_dR'
|
62
|
+
results.people.all.last.first_name.should == 'Pablo'
|
63
|
+
results.people.all.last.last_name.should == 'C.'
|
64
|
+
results.people.all.last.id.should == 'pdzrGpyP0h'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe "by first_name and last_name options" do
|
69
|
+
use_vcr_cassette :record => :new_episodes
|
70
|
+
|
71
|
+
let(:results) do
|
72
|
+
client.search(:first_name => 'Giliardi', :last_name => 'Pires')
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should perform a search" do
|
76
|
+
results.people.all.size.should == 1
|
77
|
+
results.people.all.first.first_name.should == 'Giliardi'
|
78
|
+
results.people.all.first.last_name.should == 'Pires'
|
79
|
+
results.people.all.first.id.should == 'YkdnFl04s_'
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "by first_name and last_name options with fields" do
|
84
|
+
use_vcr_cassette :record => :new_episodes
|
85
|
+
|
86
|
+
let(:results) do
|
87
|
+
fields = [{:people => [:id, :first_name, :last_name, :public_profile_url, :picture_url]}, :num_results]
|
88
|
+
client.search(:first_name => 'Giliardi', :last_name => 'Pires', :fields => fields)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should perform a search" do
|
92
|
+
results.people.all.size.should == 1
|
93
|
+
results.people.all.first.first_name.should == 'Giliardi'
|
94
|
+
results.people.all.first.last_name.should == 'Pires'
|
95
|
+
results.people.all.first.id.should == 'YkdnFl04s_'
|
96
|
+
results.people.all.first.picture_url == 'http://media.linkedin.com/mpr/mprx/0_Oz05kn9xkWziAEOUKtOVkqzjXd8Clf7UyqIVkqchR2NtmwZRt1fWoN_aobhg-HmB09jUwPLKrAhU'
|
97
|
+
results.people.all.first.public_profile_url == 'http://www.linkedin.com/in/gibanet'
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "by company_name option" do
|
102
|
+
use_vcr_cassette :record => :new_episodes
|
103
|
+
|
104
|
+
let(:results) do
|
105
|
+
client.search(:company_name => 'linkedin')
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should perform a search" do
|
109
|
+
results.people.all.size.should == 10
|
110
|
+
results.people.all.first.first_name.should == 'Donald'
|
111
|
+
results.people.all.first.last_name.should == 'Denker'
|
112
|
+
results.people.all.first.id.should == 'VQcsz5Hp_h'
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe "#field_selector" do
|
117
|
+
it "should not modify the parameter object" do
|
118
|
+
fields = [{:people => [:id, :first_name]}]
|
119
|
+
fields_dup = fields.dup
|
120
|
+
client.send(:field_selector, fields)
|
121
|
+
fields.should eq fields_dup
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://api.linkedin.com:443/v1/companies/id=1586
|
6
|
+
body: !!null
|
7
|
+
headers:
|
8
|
+
x-li-format:
|
9
|
+
- json
|
10
|
+
user-agent:
|
11
|
+
- OAuth gem v0.4.5
|
12
|
+
authorization:
|
13
|
+
- OAuth oauth_consumer_key="consumer_key",
|
14
|
+
oauth_nonce="nonce", oauth_signature="signature",
|
15
|
+
oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129843", oauth_token="token",
|
16
|
+
oauth_version="1.0"
|
17
|
+
response: !ruby/struct:VCR::Response
|
18
|
+
status: !ruby/struct:VCR::ResponseStatus
|
19
|
+
code: 200
|
20
|
+
message: OK
|
21
|
+
headers:
|
22
|
+
server:
|
23
|
+
- Apache-Coyote/1.1
|
24
|
+
vary:
|
25
|
+
- ! '*'
|
26
|
+
x-li-format:
|
27
|
+
- json
|
28
|
+
content-type:
|
29
|
+
- application/json;charset=UTF-8
|
30
|
+
transfer-encoding:
|
31
|
+
- chunked
|
32
|
+
date:
|
33
|
+
- Thu, 20 Oct 2011 16:57:24 GMT
|
34
|
+
body: ! "{\n \"id\": 1586,\n \"name\": \"Amazon\"\n}"
|
35
|
+
http_version: '1.1'
|
36
|
+
- !ruby/struct:VCR::HTTPInteraction
|
37
|
+
request: !ruby/struct:VCR::Request
|
38
|
+
method: :get
|
39
|
+
uri: https://api.linkedin.com:443/v1/companies/id=1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range)
|
40
|
+
body: !!null
|
41
|
+
headers:
|
42
|
+
x-li-format:
|
43
|
+
- json
|
44
|
+
user-agent:
|
45
|
+
- OAuth gem v0.4.5
|
46
|
+
authorization:
|
47
|
+
- OAuth oauth_consumer_key="consumer_key",
|
48
|
+
oauth_nonce="nonc", oauth_signature="signature",
|
49
|
+
oauth_signature_method="HMAC-SHA1", oauth_timestamp="1319129844", oauth_token="token",
|
50
|
+
oauth_version="1.0"
|
51
|
+
response: !ruby/struct:VCR::Response
|
52
|
+
status: !ruby/struct:VCR::ResponseStatus
|
53
|
+
code: 200
|
54
|
+
message: OK
|
55
|
+
headers:
|
56
|
+
server:
|
57
|
+
- Apache-Coyote/1.1
|
58
|
+
vary:
|
59
|
+
- ! '*'
|
60
|
+
x-li-format:
|
61
|
+
- json
|
62
|
+
content-type:
|
63
|
+
- application/json;charset=UTF-8
|
64
|
+
transfer-encoding:
|
65
|
+
- chunked
|
66
|
+
date:
|
67
|
+
- Thu, 20 Oct 2011 16:57:24 GMT
|
68
|
+
body: ! "{\n \"employeeCountRange\": {\n \"code\": \"I\",\n \"name\": \"10001+\"\n
|
69
|
+
},\n \"id\": 1586,\n \"industry\": \"Internet\",\n \"locations\": {\n \"_total\":
|
70
|
+
1,\n \"values\": [{\n \"address\": {\n \"city\": \"Seattle\",\n
|
71
|
+
\"countryCode\": \"us\",\n \"state\": \"WA\"\n },\n \"isHeadquarters\":
|
72
|
+
true\n }]\n },\n \"name\": \"Amazon\"\n}"
|
73
|
+
http_version: '1.1'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://api.linkedin.com:443/uas/oauth/accessToken
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
content-length:
|
13
|
+
- "0"
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- text/plain
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Mon, 07 Feb 2011 16:10:34 GMT
|
25
|
+
content-length:
|
26
|
+
- "156"
|
27
|
+
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
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://api.linkedin.com:443/uas/oauth/requestToken
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
content-length:
|
13
|
+
- "0"
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- text/plain
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Mon, 07 Feb 2011 18:36:30 GMT
|
25
|
+
content-length:
|
26
|
+
- "236"
|
27
|
+
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
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://api.linkedin.com:443/uas/oauth/requestToken
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
content-length:
|
13
|
+
- "0"
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- text/plain
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Mon, 07 Feb 2011 18:36:29 GMT
|
25
|
+
content-length:
|
26
|
+
- "236"
|
27
|
+
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
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://api.linkedin.com:443/uas/oauth/requestToken
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
content-length:
|
13
|
+
- "0"
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- text/plain
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Mon, 07 Feb 2011 15:45:08 GMT
|
25
|
+
content-length:
|
26
|
+
- "236"
|
27
|
+
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
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,92 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://api.linkedin.com:443/v1/people-search?company-name=linkedin
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
x-li-format:
|
13
|
+
- json
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json;charset=UTF-8
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Tue, 10 May 2011 21:02:49 GMT
|
25
|
+
x-li-format:
|
26
|
+
- json
|
27
|
+
vary:
|
28
|
+
- x-li-format,Accept-Encoding
|
29
|
+
transfer-encoding:
|
30
|
+
- chunked
|
31
|
+
body: |-
|
32
|
+
{
|
33
|
+
"numResults": 5228,
|
34
|
+
"people": {
|
35
|
+
"values": [
|
36
|
+
{
|
37
|
+
"id": "VQcsz5Hp_h",
|
38
|
+
"lastName": "Denker",
|
39
|
+
"firstName": "Donald"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"id": "YEDghC612B",
|
43
|
+
"lastName": "S.",
|
44
|
+
"firstName": "Daniel"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"id": "KMioNXVEg9",
|
48
|
+
"lastName": "H.",
|
49
|
+
"firstName": "Reid"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"id": "ILGTOKmto4",
|
53
|
+
"lastName": "Ruff",
|
54
|
+
"firstName": "Lori"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"id": "xr5jcMXKPm",
|
58
|
+
"lastName": "C.",
|
59
|
+
"firstName": "Ed"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"id": "aeejoSqHsN",
|
63
|
+
"lastName": "T.",
|
64
|
+
"firstName": "Brian"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"id": "VYC0P9hxVN",
|
68
|
+
"lastName": "Giffen",
|
69
|
+
"firstName": "Sean"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"id": "kWPJPI1lrJ",
|
73
|
+
"lastName": "Seps",
|
74
|
+
"firstName": "Chad"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"id": "1PYJr69P5V",
|
78
|
+
"lastName": "Vasconcelos",
|
79
|
+
"firstName": "Cesar"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"id": "AU5Dv63Fma",
|
83
|
+
"lastName": "Ling",
|
84
|
+
"firstName": "James"
|
85
|
+
}
|
86
|
+
],
|
87
|
+
"_count": 10,
|
88
|
+
"_start": 0,
|
89
|
+
"_total": 110
|
90
|
+
}
|
91
|
+
}
|
92
|
+
http_version: "1.1"
|
data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://api.linkedin.com:443/v1/people-search?first-name=Giliardi&last-name=Pires
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
x-li-format:
|
13
|
+
- json
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json;charset=UTF-8
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Tue, 10 May 2011 21:02:45 GMT
|
25
|
+
x-li-format:
|
26
|
+
- json
|
27
|
+
vary:
|
28
|
+
- x-li-format,Accept-Encoding
|
29
|
+
transfer-encoding:
|
30
|
+
- chunked
|
31
|
+
body: |-
|
32
|
+
{
|
33
|
+
"numResults": 1,
|
34
|
+
"people": {
|
35
|
+
"values": [{
|
36
|
+
"id": "YkdnFl04s_",
|
37
|
+
"lastName": "Pires",
|
38
|
+
"firstName": "Giliardi"
|
39
|
+
}],
|
40
|
+
"_total": 1
|
41
|
+
}
|
42
|
+
}
|
43
|
+
http_version: "1.1"
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
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
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- OAuth gem v0.4.4
|
10
|
+
authorization:
|
11
|
+
- 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"
|
12
|
+
x-li-format:
|
13
|
+
- json
|
14
|
+
response: !ruby/struct:VCR::Response
|
15
|
+
status: !ruby/struct:VCR::ResponseStatus
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json;charset=UTF-8
|
21
|
+
server:
|
22
|
+
- Apache-Coyote/1.1
|
23
|
+
date:
|
24
|
+
- Tue, 10 May 2011 21:02:47 GMT
|
25
|
+
x-li-format:
|
26
|
+
- json
|
27
|
+
vary:
|
28
|
+
- x-li-format,Accept-Encoding
|
29
|
+
transfer-encoding:
|
30
|
+
- chunked
|
31
|
+
body: |-
|
32
|
+
{
|
33
|
+
"numResults": 1,
|
34
|
+
"people": {
|
35
|
+
"values": [{
|
36
|
+
"id": "YkdnFl04s_",
|
37
|
+
"publicProfileUrl": "http://www.linkedin.com/in/gibanet",
|
38
|
+
"lastName": "Pires",
|
39
|
+
"pictureUrl": "http://media.linkedin.com/mpr/mprx/0_Oz05kn9xkWziAEOUKtOVkqzjXd8Clf7UyqIVkqchR2NtmwZRt1fWoN_aobhg-HmB09jUwPLKrAhU",
|
40
|
+
"firstName": "Giliardi"
|
41
|
+
}],
|
42
|
+
"_total": 1
|
43
|
+
}
|
44
|
+
}
|
45
|
+
http_version: "1.1"
|