cl_linkedin 0.2.3

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 (73) hide show
  1. data/.autotest +14 -0
  2. data/.document +5 -0
  3. data/.gitignore +25 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE +20 -0
  6. data/README.markdown +80 -0
  7. data/Rakefile +41 -0
  8. data/VERSION +1 -0
  9. data/changelog.markdown +76 -0
  10. data/examples/authenticate.rb +21 -0
  11. data/examples/network.rb +12 -0
  12. data/examples/profile.rb +12 -0
  13. data/examples/status.rb +9 -0
  14. data/lib/linked_in/api_standard_profile_request.rb +17 -0
  15. data/lib/linked_in/authorization_helpers.rb +48 -0
  16. data/lib/linked_in/base.rb +13 -0
  17. data/lib/linked_in/birthdate.rb +21 -0
  18. data/lib/linked_in/client.rb +154 -0
  19. data/lib/linked_in/company.rb +11 -0
  20. data/lib/linked_in/connections.rb +16 -0
  21. data/lib/linked_in/country.rb +9 -0
  22. data/lib/linked_in/current_share.rb +56 -0
  23. data/lib/linked_in/education.rb +41 -0
  24. data/lib/linked_in/error.rb +21 -0
  25. data/lib/linked_in/group.rb +32 -0
  26. data/lib/linked_in/im_account.rb +28 -0
  27. data/lib/linked_in/languages.rb +28 -0
  28. data/lib/linked_in/likes.rb +23 -0
  29. data/lib/linked_in/location.rb +13 -0
  30. data/lib/linked_in/message.rb +20 -0
  31. data/lib/linked_in/network.rb +12 -0
  32. data/lib/linked_in/patents.rb +42 -0
  33. data/lib/linked_in/people.rb +18 -0
  34. data/lib/linked_in/person.rb +7 -0
  35. data/lib/linked_in/phone_number.rb +29 -0
  36. data/lib/linked_in/position.rb +46 -0
  37. data/lib/linked_in/profile.rb +94 -0
  38. data/lib/linked_in/publications.rb +40 -0
  39. data/lib/linked_in/recipient.rb +7 -0
  40. data/lib/linked_in/recipients.rb +18 -0
  41. data/lib/linked_in/recommendations.rb +30 -0
  42. data/lib/linked_in/request_helpers.rb +78 -0
  43. data/lib/linked_in/short_profile.rb +13 -0
  44. data/lib/linked_in/skill.rb +33 -0
  45. data/lib/linked_in/to_xml_helpers.rb +53 -0
  46. data/lib/linked_in/twitter_account.rb +28 -0
  47. data/lib/linked_in/update.rb +23 -0
  48. data/lib/linked_in/url_resource.rb +26 -0
  49. data/lib/linkedin.rb +83 -0
  50. data/linkedin.gemspec +49 -0
  51. data/spec/cases/client_spec.rb +230 -0
  52. data/spec/cases/linkedin_spec.rb +37 -0
  53. data/spec/cases/oauth_spec.rb +109 -0
  54. data/spec/client_shared_examples.orig.rb +91 -0
  55. data/spec/client_shared_examples.rb +104 -0
  56. data/spec/fixtures/403.xml +7 -0
  57. data/spec/fixtures/404.xml +7 -0
  58. data/spec/fixtures/blank.xml +0 -0
  59. data/spec/fixtures/connections.xml +3733 -0
  60. data/spec/fixtures/likes.xml +18 -0
  61. data/spec/fixtures/mailbox_items.xml +16 -0
  62. data/spec/fixtures/network_status_with_group.xml +44 -0
  63. data/spec/fixtures/network_statuses.xml +317 -0
  64. data/spec/fixtures/picture_updates.xml +117 -0
  65. data/spec/fixtures/profile.xml +9 -0
  66. data/spec/fixtures/profile_full.orig.xml +3909 -0
  67. data/spec/fixtures/profile_full.xml +395 -0
  68. data/spec/fixtures/profile_with_positions.xml +79 -0
  69. data/spec/fixtures/search.xml +538 -0
  70. data/spec/fixtures/shares.xml +12 -0
  71. data/spec/fixtures/status.xml +2 -0
  72. data/spec/spec_helper.rb +58 -0
  73. metadata +242 -0
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <share>
3
+ <comment>Testing out the LinkedIn API</comment>
4
+ <content>
5
+ <title>Share</title>
6
+ <submitted-url>http://www.linkedin.com</submitted-url>
7
+ <submitted-image-url>http://www.linkedin.com/pretty_logo.jpg</submitted-image-url>
8
+ </content>
9
+ <visibility>
10
+ <code>anyone</code>
11
+ </visibility>
12
+ </share>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <current-status>New blog post: What makes a good API wrapper? http://wynnnetherland.com/2009/11/what-makes-a-good-api-wrapper/</current-status>
@@ -0,0 +1,58 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'although not required, bundler is recommened for running the tests'
5
+ end
6
+
7
+ require 'webmock/rspec'
8
+
9
+ require 'client_shared_examples'
10
+
11
+ require 'cl_linkedin'
12
+
13
+
14
+
15
+ def fixture_path
16
+ File.expand_path("../fixtures", __FILE__)
17
+ end
18
+
19
+ def fixture(file)
20
+ File.new(fixture_path + '/' + file)
21
+ end
22
+
23
+
24
+ def linkedin_url(url)
25
+ url =~ /^http/ ? url : "https://api.linkedin.com#{url}"
26
+ end
27
+
28
+
29
+ def stub_get(url, filename, status=nil)
30
+ options = { :body => fixture(filename) }
31
+ options.merge!({ :status => status }) if status
32
+
33
+ stub_request(:get, linkedin_url(url)).to_return(options)
34
+ end
35
+
36
+ def stub_post(url, result)
37
+ result_hash = { :status => 201 }
38
+ result_hash[:body] = fixture(result) if result
39
+
40
+ stub_request(:post, linkedin_url(url)).to_return(result_hash)
41
+ end
42
+
43
+ def expect_post(url, body, result = nil)
44
+ a_request(:post, linkedin_url(url)).with({
45
+ :body => fixture(body).read,
46
+ :headers => { :content_type => 'application/xml' }
47
+ }).should have_been_made.once
48
+ end
49
+
50
+ def stub_put(url, returns_xml, status=nil)
51
+ options = { :body => fixture(returns_xml) }
52
+ options.merge!({ :status => status }) if status
53
+ stub_request(:put, linkedin_url(url)).to_return(options)
54
+ end
55
+
56
+ def stub_delete(url, returns_xml)
57
+ stub_request(:delete, linkedin_url(url)).to_return(:body => fixture(returns_xml))
58
+ end
metadata ADDED
@@ -0,0 +1,242 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cl_linkedin
3
+ version: !ruby/object:Gem::Version
4
+ hash: 17
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 3
10
+ version: 0.2.3
11
+ platform: ruby
12
+ authors:
13
+ - Wynn Netherland
14
+ - Josh Kalderimis
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2010-03-01 00:00:00 -08:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: oauth
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 15
31
+ segments:
32
+ - 0
33
+ - 4
34
+ - 0
35
+ version: 0.4.0
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ name: nokogiri
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ hash: 15
47
+ segments:
48
+ - 1
49
+ - 4
50
+ - 4
51
+ version: 1.4.4
52
+ type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: rspec
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ hash: 31
63
+ segments:
64
+ - 2
65
+ - 4
66
+ - 0
67
+ version: 2.4.0
68
+ type: :development
69
+ version_requirements: *id003
70
+ - !ruby/object:Gem::Dependency
71
+ name: rake
72
+ prerelease: false
73
+ requirement: &id004 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ hash: 49
79
+ segments:
80
+ - 0
81
+ - 8
82
+ - 7
83
+ version: 0.8.7
84
+ type: :development
85
+ version_requirements: *id004
86
+ - !ruby/object:Gem::Dependency
87
+ name: webmock
88
+ prerelease: false
89
+ requirement: &id005 !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ~>
93
+ - !ruby/object:Gem::Version
94
+ hash: 15
95
+ segments:
96
+ - 1
97
+ - 6
98
+ - 0
99
+ version: 1.6.0
100
+ type: :development
101
+ version_requirements: *id005
102
+ description: Ruby wrapper for the LinkedIn API
103
+ email:
104
+ - wynn.netherland@gmail.com
105
+ - josh.kalderimis@gmail.com
106
+ executables: []
107
+
108
+ extensions: []
109
+
110
+ extra_rdoc_files:
111
+ - README.markdown
112
+ - LICENSE
113
+ files:
114
+ - .autotest
115
+ - .document
116
+ - .gitignore
117
+ - Gemfile
118
+ - LICENSE
119
+ - README.markdown
120
+ - Rakefile
121
+ - VERSION
122
+ - changelog.markdown
123
+ - examples/authenticate.rb
124
+ - examples/network.rb
125
+ - examples/profile.rb
126
+ - examples/status.rb
127
+ - lib/linked_in/api_standard_profile_request.rb
128
+ - lib/linked_in/authorization_helpers.rb
129
+ - lib/linked_in/base.rb
130
+ - lib/linked_in/birthdate.rb
131
+ - lib/linked_in/client.rb
132
+ - lib/linked_in/company.rb
133
+ - lib/linked_in/connections.rb
134
+ - lib/linked_in/country.rb
135
+ - lib/linked_in/current_share.rb
136
+ - lib/linked_in/education.rb
137
+ - lib/linked_in/error.rb
138
+ - lib/linked_in/group.rb
139
+ - lib/linked_in/im_account.rb
140
+ - lib/linked_in/languages.rb
141
+ - lib/linked_in/likes.rb
142
+ - lib/linked_in/location.rb
143
+ - lib/linked_in/message.rb
144
+ - lib/linked_in/network.rb
145
+ - lib/linked_in/patents.rb
146
+ - lib/linked_in/people.rb
147
+ - lib/linked_in/person.rb
148
+ - lib/linked_in/phone_number.rb
149
+ - lib/linked_in/position.rb
150
+ - lib/linked_in/profile.rb
151
+ - lib/linked_in/publications.rb
152
+ - lib/linked_in/recipient.rb
153
+ - lib/linked_in/recipients.rb
154
+ - lib/linked_in/recommendations.rb
155
+ - lib/linked_in/request_helpers.rb
156
+ - lib/linked_in/short_profile.rb
157
+ - lib/linked_in/skill.rb
158
+ - lib/linked_in/to_xml_helpers.rb
159
+ - lib/linked_in/twitter_account.rb
160
+ - lib/linked_in/update.rb
161
+ - lib/linked_in/url_resource.rb
162
+ - lib/linkedin.rb
163
+ - linkedin.gemspec
164
+ - spec/cases/client_spec.rb
165
+ - spec/cases/linkedin_spec.rb
166
+ - spec/cases/oauth_spec.rb
167
+ - spec/client_shared_examples.orig.rb
168
+ - spec/client_shared_examples.rb
169
+ - spec/fixtures/403.xml
170
+ - spec/fixtures/404.xml
171
+ - spec/fixtures/blank.xml
172
+ - spec/fixtures/connections.xml
173
+ - spec/fixtures/likes.xml
174
+ - spec/fixtures/mailbox_items.xml
175
+ - spec/fixtures/network_status_with_group.xml
176
+ - spec/fixtures/network_statuses.xml
177
+ - spec/fixtures/picture_updates.xml
178
+ - spec/fixtures/profile.xml
179
+ - spec/fixtures/profile_full.orig.xml
180
+ - spec/fixtures/profile_full.xml
181
+ - spec/fixtures/profile_with_positions.xml
182
+ - spec/fixtures/search.xml
183
+ - spec/fixtures/shares.xml
184
+ - spec/fixtures/status.xml
185
+ - spec/spec_helper.rb
186
+ has_rdoc: true
187
+ homepage: http://github.com/pengwynn/linkedin
188
+ licenses: []
189
+
190
+ post_install_message:
191
+ rdoc_options:
192
+ - --charset=UTF-8
193
+ require_paths:
194
+ - lib
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ none: false
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ hash: 3
201
+ segments:
202
+ - 0
203
+ version: "0"
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
205
+ none: false
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ hash: 3
210
+ segments:
211
+ - 0
212
+ version: "0"
213
+ requirements: []
214
+
215
+ rubyforge_project:
216
+ rubygems_version: 1.3.7
217
+ signing_key:
218
+ specification_version: 3
219
+ summary: Ruby wrapper for the LinkedIn API
220
+ test_files:
221
+ - spec/cases/client_spec.rb
222
+ - spec/cases/linkedin_spec.rb
223
+ - spec/cases/oauth_spec.rb
224
+ - spec/client_shared_examples.orig.rb
225
+ - spec/client_shared_examples.rb
226
+ - spec/fixtures/403.xml
227
+ - spec/fixtures/404.xml
228
+ - spec/fixtures/blank.xml
229
+ - spec/fixtures/connections.xml
230
+ - spec/fixtures/likes.xml
231
+ - spec/fixtures/mailbox_items.xml
232
+ - spec/fixtures/network_status_with_group.xml
233
+ - spec/fixtures/network_statuses.xml
234
+ - spec/fixtures/picture_updates.xml
235
+ - spec/fixtures/profile.xml
236
+ - spec/fixtures/profile_full.orig.xml
237
+ - spec/fixtures/profile_full.xml
238
+ - spec/fixtures/profile_with_positions.xml
239
+ - spec/fixtures/search.xml
240
+ - spec/fixtures/shares.xml
241
+ - spec/fixtures/status.xml
242
+ - spec/spec_helper.rb