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.
Files changed (47) hide show
  1. data/.autotest +14 -0
  2. data/.document +5 -0
  3. data/.gemtest +0 -0
  4. data/.gitignore +41 -0
  5. data/.rspec +1 -0
  6. data/.travis.yml +5 -0
  7. data/Gemfile +7 -0
  8. data/LICENSE +20 -0
  9. data/README.markdown +78 -0
  10. data/Rakefile +19 -0
  11. data/changelog.markdown +71 -0
  12. data/examples/authenticate.rb +21 -0
  13. data/examples/network.rb +12 -0
  14. data/examples/profile.rb +18 -0
  15. data/examples/sinatra.rb +82 -0
  16. data/examples/status.rb +9 -0
  17. data/lib/linked_in/api/query_methods.rb +101 -0
  18. data/lib/linked_in/api/update_methods.rb +82 -0
  19. data/lib/linked_in/api.rb +6 -0
  20. data/lib/linked_in/client.rb +46 -0
  21. data/lib/linked_in/errors.rb +18 -0
  22. data/lib/linked_in/helpers/authorization.rb +68 -0
  23. data/lib/linked_in/helpers/request.rb +78 -0
  24. data/lib/linked_in/helpers.rb +6 -0
  25. data/lib/linked_in/mash.rb +68 -0
  26. data/lib/linked_in/search.rb +56 -0
  27. data/lib/linked_in/version.rb +11 -0
  28. data/lib/linkedin.rb +32 -0
  29. data/linkedin.gemspec +25 -0
  30. data/spec/cases/api_spec.rb +86 -0
  31. data/spec/cases/linkedin_spec.rb +37 -0
  32. data/spec/cases/mash_spec.rb +85 -0
  33. data/spec/cases/oauth_spec.rb +166 -0
  34. data/spec/cases/search_spec.rb +127 -0
  35. data/spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml +73 -0
  36. data/spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml +28 -0
  37. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml +28 -0
  38. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml +28 -0
  39. data/spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml +28 -0
  40. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml +92 -0
  41. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml +43 -0
  42. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml +45 -0
  43. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml +92 -0
  44. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml +92 -0
  45. data/spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml +67 -0
  46. data/spec/helper.rb +30 -0
  47. metadata +205 -0
@@ -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?keywords=github
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="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"
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:40 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": 905,
34
+ "people": {
35
+ "values": [
36
+ {
37
+ "id": "YkdnFl04s_",
38
+ "lastName": "Pires",
39
+ "firstName": "Giliardi"
40
+ },
41
+ {
42
+ "id": "5oELVyNfN3",
43
+ "lastName": "Alencar",
44
+ "firstName": "Ivan"
45
+ },
46
+ {
47
+ "id": "k-wxkgFDYL",
48
+ "lastName": "Private",
49
+ "firstName": ""
50
+ },
51
+ {
52
+ "id": "xT-OdnpncE",
53
+ "lastName": "Private",
54
+ "firstName": ""
55
+ },
56
+ {
57
+ "id": "GAG-lE3XVw",
58
+ "lastName": "Private",
59
+ "firstName": ""
60
+ },
61
+ {
62
+ "id": "z2XMcxa_dR",
63
+ "lastName": "M.",
64
+ "firstName": "Stephen"
65
+ },
66
+ {
67
+ "id": "cPANxsayPK",
68
+ "lastName": "Private",
69
+ "firstName": ""
70
+ },
71
+ {
72
+ "id": "SbMT09zllx",
73
+ "lastName": "L.",
74
+ "firstName": "Rodolfo"
75
+ },
76
+ {
77
+ "id": "GrH-5d4mH1",
78
+ "lastName": "Barnaba",
79
+ "firstName": "Marcello"
80
+ },
81
+ {
82
+ "id": "pdzrGpyP0h",
83
+ "lastName": "C.",
84
+ "firstName": "Pablo"
85
+ }
86
+ ],
87
+ "_count": 10,
88
+ "_start": 0,
89
+ "_total": 110
90
+ }
91
+ }
92
+ 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?keywords=github
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="neCS0f9bL8RywiUOvLLDBfAwnc3wmlyFH3N2k4v2PmU", oauth_signature="0EgRN6GvhW3WdWMS8g0gdbOp9Do%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1305061361", 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:41 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": 905,
34
+ "people": {
35
+ "values": [
36
+ {
37
+ "id": "YkdnFl04s_",
38
+ "lastName": "Pires",
39
+ "firstName": "Giliardi"
40
+ },
41
+ {
42
+ "id": "5oELVyNfN3",
43
+ "lastName": "Alencar",
44
+ "firstName": "Ivan"
45
+ },
46
+ {
47
+ "id": "k-wxkgFDYL",
48
+ "lastName": "Private",
49
+ "firstName": ""
50
+ },
51
+ {
52
+ "id": "xT-OdnpncE",
53
+ "lastName": "Private",
54
+ "firstName": ""
55
+ },
56
+ {
57
+ "id": "GAG-lE3XVw",
58
+ "lastName": "Private",
59
+ "firstName": ""
60
+ },
61
+ {
62
+ "id": "z2XMcxa_dR",
63
+ "lastName": "M.",
64
+ "firstName": "Stephen"
65
+ },
66
+ {
67
+ "id": "cPANxsayPK",
68
+ "lastName": "Private",
69
+ "firstName": ""
70
+ },
71
+ {
72
+ "id": "SbMT09zllx",
73
+ "lastName": "L.",
74
+ "firstName": "Rodolfo"
75
+ },
76
+ {
77
+ "id": "GrH-5d4mH1",
78
+ "lastName": "Barnaba",
79
+ "firstName": "Marcello"
80
+ },
81
+ {
82
+ "id": "pdzrGpyP0h",
83
+ "lastName": "C.",
84
+ "firstName": "Pablo"
85
+ }
86
+ ],
87
+ "_count": 10,
88
+ "_start": 0,
89
+ "_total": 110
90
+ }
91
+ }
92
+ http_version: "1.1"
@@ -0,0 +1,67 @@
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?count=5&keywords=github&start=5
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="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"
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:44 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": 905,
34
+ "people": {
35
+ "values": [
36
+ {
37
+ "id": "z2XMcxa_dR",
38
+ "lastName": "M.",
39
+ "firstName": "Stephen"
40
+ },
41
+ {
42
+ "id": "cPANxsayPK",
43
+ "lastName": "Private",
44
+ "firstName": ""
45
+ },
46
+ {
47
+ "id": "SbMT09zllx",
48
+ "lastName": "L.",
49
+ "firstName": "Rodolfo"
50
+ },
51
+ {
52
+ "id": "GrH-5d4mH1",
53
+ "lastName": "Barnaba",
54
+ "firstName": "Marcello"
55
+ },
56
+ {
57
+ "id": "pdzrGpyP0h",
58
+ "lastName": "C.",
59
+ "firstName": "Pablo"
60
+ }
61
+ ],
62
+ "_count": 5,
63
+ "_start": 5,
64
+ "_total": 110
65
+ }
66
+ }
67
+ http_version: "1.1"
data/spec/helper.rb ADDED
@@ -0,0 +1,30 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'linkedin'
6
+ require 'rspec'
7
+ require 'webmock/rspec'
8
+ require 'vcr'
9
+
10
+ VCR.config do |c|
11
+ c.cassette_library_dir = 'spec/fixtures/cassette_library'
12
+ c.stub_with :webmock
13
+ c.ignore_localhost = true
14
+ c.default_cassette_options = { :record => :none }
15
+ end
16
+
17
+ RSpec.configure do |c|
18
+ c.extend VCR::RSpec::Macros
19
+ end
20
+
21
+ def linkedin_url(url)
22
+ url =~ /^http/ ? url : "https://api.linkedin.com#{url}"
23
+ end
24
+
25
+ def expect_post(url, body, result = nil)
26
+ a_request(:post, linkedin_url(url)).with({
27
+ :body => fixture(body).read,
28
+ :headers => { :content_type => 'application/xml' }
29
+ }).should have_been_made.once
30
+ end
metadata ADDED
@@ -0,0 +1,205 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crankin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.6
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Wynn Netherland
9
+ - Josh Kalderimis
10
+ - Matt Burke
11
+ - Ben Shymkiw
12
+ autorequire:
13
+ bindir: bin
14
+ cert_chain: []
15
+ date: 2012-05-29 00:00:00.000000000Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: hashie
19
+ requirement: &75890190 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 1.2.0
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: *75890190
28
+ - !ruby/object:Gem::Dependency
29
+ name: multi_json
30
+ requirement: &75889460 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 1.0.3
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: *75889460
39
+ - !ruby/object:Gem::Dependency
40
+ name: oauth
41
+ requirement: &75888870 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 0.4.5
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *75888870
50
+ - !ruby/object:Gem::Dependency
51
+ name: json
52
+ requirement: &75888300 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: '1.6'
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: *75888300
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: &75887110 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '0.9'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: *75887110
72
+ - !ruby/object:Gem::Dependency
73
+ name: rdoc
74
+ requirement: &75885420 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: '3.8'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: *75885420
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: &75866180 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: '2.6'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: *75866180
94
+ - !ruby/object:Gem::Dependency
95
+ name: simplecov
96
+ requirement: &75865340 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '0.5'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: *75865340
105
+ - !ruby/object:Gem::Dependency
106
+ name: vcr
107
+ requirement: &75864730 !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ~>
111
+ - !ruby/object:Gem::Version
112
+ version: '1.10'
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: *75864730
116
+ - !ruby/object:Gem::Dependency
117
+ name: webmock
118
+ requirement: &75864310 !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ~>
122
+ - !ruby/object:Gem::Version
123
+ version: '1.7'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: *75864310
127
+ description: Ruby wrapper for the LinkedIn API
128
+ email:
129
+ - wynn.netherland@gmail.com
130
+ - josh.kalderimis@gmail.com
131
+ executables: []
132
+ extensions: []
133
+ extra_rdoc_files: []
134
+ files:
135
+ - .autotest
136
+ - .document
137
+ - .gemtest
138
+ - .gitignore
139
+ - .rspec
140
+ - .travis.yml
141
+ - Gemfile
142
+ - LICENSE
143
+ - README.markdown
144
+ - Rakefile
145
+ - changelog.markdown
146
+ - examples/authenticate.rb
147
+ - examples/network.rb
148
+ - examples/profile.rb
149
+ - examples/sinatra.rb
150
+ - examples/status.rb
151
+ - lib/linked_in/api.rb
152
+ - lib/linked_in/api/query_methods.rb
153
+ - lib/linked_in/api/update_methods.rb
154
+ - lib/linked_in/client.rb
155
+ - lib/linked_in/errors.rb
156
+ - lib/linked_in/helpers.rb
157
+ - lib/linked_in/helpers/authorization.rb
158
+ - lib/linked_in/helpers/request.rb
159
+ - lib/linked_in/mash.rb
160
+ - lib/linked_in/search.rb
161
+ - lib/linked_in/version.rb
162
+ - lib/linkedin.rb
163
+ - linkedin.gemspec
164
+ - spec/cases/api_spec.rb
165
+ - spec/cases/linkedin_spec.rb
166
+ - spec/cases/mash_spec.rb
167
+ - spec/cases/oauth_spec.rb
168
+ - spec/cases/search_spec.rb
169
+ - spec/fixtures/cassette_library/LinkedIn_Api/Company_API.yml
170
+ - spec/fixtures/cassette_library/LinkedIn_Client/_authorize_from_request.yml
171
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token.yml
172
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_a_callback_url.yml
173
+ - spec/fixtures/cassette_library/LinkedIn_Client/_request_token/with_default_options.yml
174
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_company_name_option.yml
175
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options.yml
176
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_first_name_and_last_name_options_with_fields.yml
177
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_keywords_string_parameter.yml
178
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option.yml
179
+ - spec/fixtures/cassette_library/LinkedIn_Search/_search/by_single_keywords_option_with_pagination.yml
180
+ - spec/helper.rb
181
+ homepage: http://github.com/iamsolarpowered/linkedin
182
+ licenses: []
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ none: false
189
+ requirements:
190
+ - - ! '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ! '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ requirements: []
200
+ rubyforge_project:
201
+ rubygems_version: 1.8.15
202
+ signing_key:
203
+ specification_version: 3
204
+ summary: Ruby wrapper for the LinkedIn API
205
+ test_files: []