linkedin2 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.travis.yml +4 -0
- data/README.md +3 -1
- data/Rakefile +6 -0
- data/lib/linkedin/api.rb +2 -0
- data/lib/linkedin/api/companies.rb +8 -2
- data/lib/linkedin/api/industries.rb +147 -147
- data/lib/linkedin/api/network_updates.rb +17 -0
- data/lib/linkedin/api/profiles.rb +4 -0
- data/lib/linkedin/base.rb +6 -3
- data/lib/linkedin/client.rb +5 -3
- data/lib/linkedin/configuration.rb +2 -2
- data/lib/linkedin/profile.rb +5 -6
- data/lib/linkedin/version.rb +1 -1
- data/linkedin.gemspec +2 -1
- data/spec/api/companies_spec.rb +20 -11
- data/spec/api/groups_spec.rb +3 -0
- data/spec/api/jobs_spec.rb +3 -0
- data/spec/api/network_updates_spec.rb +32 -0
- data/spec/api/profiles_spec.rb +36 -26
- data/spec/faraday_middleware/linkedin_error_response_spec.rb +10 -4
- data/spec/fixtures/requests/access_token.yml +55 -22
- data/spec/fixtures/requests/companies.yml +258 -0
- data/spec/fixtures/requests/invalid.yml +51 -0
- data/spec/fixtures/requests/network_updates.yml +743 -0
- data/spec/fixtures/requests/profiles.yml +201 -0
- data/spec/spec_helper.rb +15 -5
- data/spec/test_app.yml +3 -0
- metadata +55 -30
- data/spec/fixtures/requests/company.yml +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d82563f7f23c803297332556810c2fa753b594
|
4
|
+
data.tar.gz: 532a7e6f0df55a6457ce1cb28b965829701c08c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f086e6f64a43aa5f06e1ca130a88bc7440c73471d46e520d0eea92c54b99c77eac8fd97129bb58e290de7933b6fa25948172ebc5cea60d3c1b23d5fed70e38f2
|
7
|
+
data.tar.gz: 733984079329092eac4517edcc93612f15be4802ebbd6b091005387d64b407d6967afcdac16bf27ed1b676ac8e82aa11ef529ce0f97cd3601f549e28a7e406cf
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# LinkedIn 2
|
2
|
+
[](https://travis-ci.org/bobbrez/linkedin2)
|
3
|
+
[](https://codeclimate.com/github/bobbrez/linkedin2)
|
2
4
|
|
3
5
|
A modernized LinkedIn Ruby client.
|
4
6
|
|
@@ -81,4 +83,4 @@ client.request_access_token '<token-from-response>'
|
|
81
83
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
82
84
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
83
85
|
4. Push to the branch (`git push origin my-new-feature`)
|
84
|
-
5. Create new Pull Request
|
86
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
2
3
|
|
3
4
|
desc 'Open an irb session preloaded with this library'
|
4
5
|
task :console do
|
5
6
|
sh 'irb -rubygems -I lib -r linkedin2.rb'
|
6
7
|
end
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new
|
10
|
+
|
11
|
+
task default: :spec
|
12
|
+
task test: :spec
|
data/lib/linkedin/api.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'linkedin/api/authentication'
|
2
2
|
require 'linkedin/api/profiles'
|
3
|
+
require 'linkedin/api/network_updates'
|
3
4
|
require 'linkedin/api/companies'
|
4
5
|
require 'linkedin/api/groups'
|
5
6
|
require 'linkedin/api/industries'
|
@@ -8,4 +9,5 @@ require 'linkedin/api/permissions'
|
|
8
9
|
|
9
10
|
include LinkedIn::API::Authentication
|
10
11
|
include LinkedIn::API::Profiles
|
12
|
+
include LinkedIn::API::NetworkUpdates
|
11
13
|
include LinkedIn::API::Companies
|
@@ -2,12 +2,18 @@ module LinkedIn
|
|
2
2
|
module API
|
3
3
|
module Companies
|
4
4
|
def company(options={})
|
5
|
-
selector = options[:selector].
|
5
|
+
selector = if options[:selector].respond_to? :each
|
6
|
+
"::(#{options[:selector].join(',')})"
|
7
|
+
else
|
8
|
+
"/#{options[:selector]}"
|
9
|
+
end
|
6
10
|
|
7
11
|
fields = options[:fields]
|
8
12
|
fields_string = fields.blank? ? '' : ":(#{Permissions.render_permissions fields})"
|
9
13
|
|
10
|
-
|
14
|
+
filter = "?#{options[:filter]}" if options[:filter].present?
|
15
|
+
|
16
|
+
get "v1/companies#{selector}#{fields_string}#{filter}"
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
@@ -21,153 +21,153 @@ module LinkedIn
|
|
21
21
|
INDUSTRIES.detect { |indust| indust[:description].to_s.downcase == description.to_s.downcase }
|
22
22
|
end
|
23
23
|
|
24
|
-
INDUSTRIES = [ { code: 1, group:
|
25
|
-
{ code: 3, group:
|
26
|
-
{ code: 4, group:
|
27
|
-
{ code: 5, group:
|
28
|
-
{ code: 6, group:
|
29
|
-
{ code: 7, group:
|
30
|
-
{ code: 8, group:
|
31
|
-
{ code: 9, group:
|
32
|
-
{ code: 10, group:
|
33
|
-
{ code: 11, group:
|
34
|
-
{ code: 12, group:
|
35
|
-
{ code: 13, group:
|
36
|
-
{ code: 14, group:
|
37
|
-
{ code: 15, group:
|
38
|
-
{ code: 16, group:
|
39
|
-
{ code: 17, group:
|
40
|
-
{ code: 18, group:
|
41
|
-
{ code: 19, group:
|
42
|
-
{ code: 20, group:
|
43
|
-
{ code: 21, group:
|
44
|
-
{ code: 22, group:
|
45
|
-
{ code: 23, group:
|
46
|
-
{ code: 24, group:
|
47
|
-
{ code: 25, group:
|
48
|
-
{ code: 26, group:
|
49
|
-
{ code: 27, group:
|
50
|
-
{ code: 28, group:
|
51
|
-
{ code: 29, group:
|
52
|
-
{ code: 30, group:
|
53
|
-
{ code: 31, group:
|
54
|
-
{ code: 32, group:
|
55
|
-
{ code: 33, group:
|
56
|
-
{ code: 34, group:
|
57
|
-
{ code: 35, group:
|
58
|
-
{ code: 36, group:
|
59
|
-
{ code: 37, group:
|
60
|
-
{ code: 38, group:
|
61
|
-
{ code: 39, group:
|
62
|
-
{ code: 40, group:
|
63
|
-
{ code: 41, group:
|
64
|
-
{ code: 42, group:
|
65
|
-
{ code: 43, group:
|
66
|
-
{ code: 44, group:
|
67
|
-
{ code: 45, group:
|
68
|
-
{ code: 46, group:
|
69
|
-
{ code: 47, group:
|
70
|
-
{ code: 48, group:
|
71
|
-
{ code: 49, group:
|
72
|
-
{ code: 50, group:
|
73
|
-
{ code: 51, group:
|
74
|
-
{ code: 52, group:
|
75
|
-
{ code: 53, group:
|
76
|
-
{ code: 54, group:
|
77
|
-
{ code: 55, group:
|
78
|
-
{ code: 56, group:
|
79
|
-
{ code: 57, group:
|
80
|
-
{ code: 58, group:
|
81
|
-
{ code: 59, group:
|
82
|
-
{ code: 60, group:
|
83
|
-
{ code: 61, group:
|
84
|
-
{ code: 62, group:
|
85
|
-
{ code: 63, group:
|
86
|
-
{ code: 64, group:
|
87
|
-
{ code: 65, group:
|
88
|
-
{ code: 66, group:
|
89
|
-
{ code: 67, group:
|
90
|
-
{ code: 68, group:
|
91
|
-
{ code: 69, group:
|
92
|
-
{ code: 70, group:
|
93
|
-
{ code: 71, group:
|
94
|
-
{ code: 72, group:
|
95
|
-
{ code: 73, group:
|
96
|
-
{ code: 74, group:
|
97
|
-
{ code: 75, group:
|
98
|
-
{ code: 76, group:
|
99
|
-
{ code: 77, group:
|
100
|
-
{ code: 78, group:
|
101
|
-
{ code: 79, group:
|
102
|
-
{ code: 80, group:
|
103
|
-
{ code: 81, group:
|
104
|
-
{ code: 82, group:
|
105
|
-
{ code: 83, group:
|
106
|
-
{ code: 84, group:
|
107
|
-
{ code: 85, group:
|
108
|
-
{ code: 86, group:
|
109
|
-
{ code: 87, group:
|
110
|
-
{ code: 88, group:
|
111
|
-
{ code: 89, group:
|
112
|
-
{ code: 90, group:
|
113
|
-
{ code: 91, group:
|
114
|
-
{ code: 92, group:
|
115
|
-
{ code: 93, group:
|
116
|
-
{ code: 94, group:
|
117
|
-
{ code: 95, group:
|
118
|
-
{ code: 96, group:
|
119
|
-
{ code: 97, group:
|
120
|
-
{ code: 98, group:
|
121
|
-
{ code: 99, group:
|
122
|
-
{ code: 100, group:
|
123
|
-
{ code: 101, group:
|
124
|
-
{ code: 102, group:
|
125
|
-
{ code: 103, group:
|
126
|
-
{ code: 104, group:
|
127
|
-
{ code: 105, group:
|
128
|
-
{ code: 106, group:
|
129
|
-
{ code: 107, group:
|
130
|
-
{ code: 108, group:
|
131
|
-
{ code: 109, group:
|
132
|
-
{ code: 110, group:
|
133
|
-
{ code: 111, group:
|
134
|
-
{ code: 112, group:
|
135
|
-
{ code: 113, group:
|
136
|
-
{ code: 114, group:
|
137
|
-
{ code: 115, group:
|
138
|
-
{ code: 116, group:
|
139
|
-
{ code: 117, group:
|
140
|
-
{ code: 118, group:
|
141
|
-
{ code: 119, group:
|
142
|
-
{ code: 120, group:
|
143
|
-
{ code: 121, group:
|
144
|
-
{ code: 122, group:
|
145
|
-
{ code: 123, group:
|
146
|
-
{ code: 124, group:
|
147
|
-
{ code: 125, group:
|
148
|
-
{ code: 126, group:
|
149
|
-
{ code: 127, group:
|
150
|
-
{ code: 128, group:
|
151
|
-
{ code: 129, group:
|
152
|
-
{ code: 130, group:
|
153
|
-
{ code: 131, group:
|
154
|
-
{ code: 132, group:
|
155
|
-
{ code: 133, group:
|
156
|
-
{ code: 134, group:
|
157
|
-
{ code: 135, group:
|
158
|
-
{ code: 136, group:
|
159
|
-
{ code: 137, group:
|
160
|
-
{ code: 138, group:
|
161
|
-
{ code: 139, group:
|
162
|
-
{ code: 140, group:
|
163
|
-
{ code: 141, group:
|
164
|
-
{ code: 142, group:
|
165
|
-
{ code: 143, group:
|
166
|
-
{ code: 144, group:
|
167
|
-
{ code: 145, group:
|
168
|
-
{ code: 146, group:
|
169
|
-
{ code: 147, group:
|
170
|
-
{ code: 148, group:
|
24
|
+
INDUSTRIES = [ { code: 1, group: [:gov, :tech], description: 'Defense & Space' },
|
25
|
+
{ code: 3, group: [:tech], description: 'Computer Hardware' },
|
26
|
+
{ code: 4, group: [:tech], description: 'Computer Software' },
|
27
|
+
{ code: 5, group: [:tech], description: 'Computer Networking' },
|
28
|
+
{ code: 6, group: [:tech], description: 'Internet' },
|
29
|
+
{ code: 7, group: [:tech], description: 'Semiconductors' },
|
30
|
+
{ code: 8, group: [:gov, :tech], description: 'Telecommunications' },
|
31
|
+
{ code: 9, group: [:leg], description: 'Law Practice' },
|
32
|
+
{ code: 10, group: [:leg], description: 'Legal Services' },
|
33
|
+
{ code: 11, group: [:corp], description: 'Management Consulting' },
|
34
|
+
{ code: 12, group: [:gov, :hlth, :tech], description: 'Biotechnology' },
|
35
|
+
{ code: 13, group: [:hlth], description: 'Medical Practice' },
|
36
|
+
{ code: 14, group: [:hlth], description: 'Hospital & Health Care' },
|
37
|
+
{ code: 15, group: [:hlth, :tech], description: 'Pharmaceuticals' },
|
38
|
+
{ code: 16, group: [:hlth], description: 'Veterinary' },
|
39
|
+
{ code: 17, group: [:hlth], description: 'Medical Devices' },
|
40
|
+
{ code: 18, group: [:good], description: 'Cosmetics' },
|
41
|
+
{ code: 19, group: [:good], description: 'Apparel & Fashion' },
|
42
|
+
{ code: 20, group: [:good, :rec], description: 'Sporting Goods' },
|
43
|
+
{ code: 21, group: [:good], description: 'Tobacco' },
|
44
|
+
{ code: 22, group: [:good], description: 'Supermarkets' },
|
45
|
+
{ code: 23, group: [:good, :man, :serv], description: 'Food Production' },
|
46
|
+
{ code: 24, group: [:good, :man], description: 'Consumer Electronics' },
|
47
|
+
{ code: 25, group: [:good, :man], description: 'Consumer Goods' },
|
48
|
+
{ code: 26, group: [:good, :man], description: 'Furniture' },
|
49
|
+
{ code: 27, group: [:good, :man], description: 'Retail' },
|
50
|
+
{ code: 28, group: [:med, :rec], description: 'Entertainment' },
|
51
|
+
{ code: 29, group: [:rec], description: 'Gambling & Casinos' },
|
52
|
+
{ code: 30, group: [:rec, :serv, :tran], description: 'Leisure, Travel & Tourism' },
|
53
|
+
{ code: 31, group: [:rec, :serv, :tran], description: 'Hospitality' },
|
54
|
+
{ code: 32, group: [:rec, :serv], description: 'Restaurants' },
|
55
|
+
{ code: 33, group: [:rec], description: 'Sports' },
|
56
|
+
{ code: 34, group: [:rec, :serv], description: 'Food & Beverages' },
|
57
|
+
{ code: 35, group: [:art, :med, :rec], description: 'Motion Pictures and Film' },
|
58
|
+
{ code: 36, group: [:med, :rec], description: 'Broadcast Media' },
|
59
|
+
{ code: 37, group: [:art, :med, :rec], description: 'Museums and Institutions' },
|
60
|
+
{ code: 38, group: [:art, :med, :rec], description: 'Fine Art' },
|
61
|
+
{ code: 39, group: [:art, :med, :rec], description: 'Performing Arts' },
|
62
|
+
{ code: 40, group: [:rec, :serv], description: 'Recreational Facilities and Services' },
|
63
|
+
{ code: 41, group: [:fin], description: 'Banking' },
|
64
|
+
{ code: 42, group: [:fin], description: 'Insurance' },
|
65
|
+
{ code: 43, group: [:fin], description: 'Financial Services' },
|
66
|
+
{ code: 44, group: [:cons, :fin, :good], description: 'Real Estate' },
|
67
|
+
{ code: 45, group: [:fin], description: 'Investment Banking' },
|
68
|
+
{ code: 46, group: [:fin], description: 'Investment Management' },
|
69
|
+
{ code: 47, group: [:corp, :fin], description: 'Accounting' },
|
70
|
+
{ code: 48, group: [:cons], description: 'Construction' },
|
71
|
+
{ code: 49, group: [:cons], description: 'Building Materials' },
|
72
|
+
{ code: 50, group: [:cons], description: 'Architecture & Planning' },
|
73
|
+
{ code: 51, group: [:cons, :gov], description: 'Civil Engineering' },
|
74
|
+
{ code: 52, group: [:gov, :man], description: 'Aviation & Aerospace' },
|
75
|
+
{ code: 53, group: [:man], description: 'Automotive' },
|
76
|
+
{ code: 54, group: [:man], description: 'Chemicals' },
|
77
|
+
{ code: 55, group: [:man], description: 'Machinery' },
|
78
|
+
{ code: 56, group: [:man], description: 'Mining & Metals' },
|
79
|
+
{ code: 57, group: [:man], description: 'Oil & Energy' },
|
80
|
+
{ code: 58, group: [:man], description: 'Shipbuilding' },
|
81
|
+
{ code: 59, group: [:man], description: 'Utilities' },
|
82
|
+
{ code: 60, group: [:man], description: 'Textiles' },
|
83
|
+
{ code: 61, group: [:man], description: 'Paper & Forest Products' },
|
84
|
+
{ code: 62, group: [:man], description: 'Railroad Manufacture' },
|
85
|
+
{ code: 63, group: [:agr], description: 'Farming' },
|
86
|
+
{ code: 64, group: [:agr], description: 'Ranching' },
|
87
|
+
{ code: 65, group: [:agr], description: 'Dairy' },
|
88
|
+
{ code: 66, group: [:agr], description: 'Fishery' },
|
89
|
+
{ code: 67, group: [:edu], description: 'Primary/Secondary Education' },
|
90
|
+
{ code: 68, group: [:edu], description: 'Higher Education' },
|
91
|
+
{ code: 69, group: [:edu], description: 'Education Management' },
|
92
|
+
{ code: 70, group: [:edu, :gov], description: 'Research' },
|
93
|
+
{ code: 71, group: [:gov], description: 'Military' },
|
94
|
+
{ code: 72, group: [:gov, :leg], description: 'Legislative Office' },
|
95
|
+
{ code: 73, group: [:gov, :leg], description: 'Judiciary' },
|
96
|
+
{ code: 74, group: [:gov], description: 'International Affairs' },
|
97
|
+
{ code: 75, group: [:gov], description: 'Government Administration' },
|
98
|
+
{ code: 76, group: [:gov], description: 'Executive Office' },
|
99
|
+
{ code: 77, group: [:gov, :leg], description: 'Law Enforcement' },
|
100
|
+
{ code: 78, group: [:gov], description: 'Public Safety' },
|
101
|
+
{ code: 79, group: [:gov], description: 'Public Policy' },
|
102
|
+
{ code: 80, group: [:corp, :med], description: 'Marketing and Advertising' },
|
103
|
+
{ code: 81, group: [:med, :rec], description: 'Newspapers' },
|
104
|
+
{ code: 82, group: [:med, :rec], description: 'Publishing' },
|
105
|
+
{ code: 83, group: [:med, :rec], description: 'Printing' },
|
106
|
+
{ code: 84, group: [:med, :serv], description: 'Information Services' },
|
107
|
+
{ code: 85, group: [:med, :rec, :serv], description: 'Libraries' },
|
108
|
+
{ code: 86, group: [:org, :serv], description: 'Environmental Services' },
|
109
|
+
{ code: 87, group: [:serv, :tran], description: 'Package/Freight Delivery' },
|
110
|
+
{ code: 88, group: [:org, :serv], description: 'Individual & Family Services' },
|
111
|
+
{ code: 89, group: [:org, :serv], description: 'Religious Institutions' },
|
112
|
+
{ code: 90, group: [:org, :serv], description: 'Civic & Social Organization' },
|
113
|
+
{ code: 91, group: [:org, :serv], description: 'Consumer Services' },
|
114
|
+
{ code: 92, group: [:tran], description: 'Transportation/Trucking/Railroad' },
|
115
|
+
{ code: 93, group: [:tran], description: 'Warehousing' },
|
116
|
+
{ code: 94, group: [:man, :tech, :tran], description: 'Airlines/Aviation' },
|
117
|
+
{ code: 95, group: [:tran], description: 'Maritime' },
|
118
|
+
{ code: 96, group: [:tech], description: 'Information Technology and Services' },
|
119
|
+
{ code: 97, group: [:corp], description: 'Market Research' },
|
120
|
+
{ code: 98, group: [:corp], description: 'Public Relations and Communications' },
|
121
|
+
{ code: 99, group: [:art, :med], description: 'Design' },
|
122
|
+
{ code: 100, group: [:org], description: 'Non-Profit Organization Management' },
|
123
|
+
{ code: 101, group: [:org], description: 'Fund-Raising' },
|
124
|
+
{ code: 102, group: [:corp, :org], description: 'Program Development' },
|
125
|
+
{ code: 103, group: [:art, :med, :rec], description: 'Writing and Editing' },
|
126
|
+
{ code: 104, group: [:corp], description: 'Staffing and Recruiting' },
|
127
|
+
{ code: 105, group: [:corp], description: 'Professional Training & Coaching' },
|
128
|
+
{ code: 106, group: [:fin, :tech], description: 'Venture Capital & Private Equity' },
|
129
|
+
{ code: 107, group: [:gov, :org], description: 'Political Organization' },
|
130
|
+
{ code: 108, group: [:corp, :gov, :serv], description: 'Translation and Localization' },
|
131
|
+
{ code: 109, group: [:med, :rec], description: 'Computer Games' },
|
132
|
+
{ code: 110, group: [:corp, :rec, :serv], description: 'Events Services' },
|
133
|
+
{ code: 111, group: [:art, :med, :rec], description: 'Arts and Crafts' },
|
134
|
+
{ code: 112, group: [:good, :man], description: 'Electrical/Electronic Manufacturing' },
|
135
|
+
{ code: 113, group: [:med], description: 'Online Media' },
|
136
|
+
{ code: 114, group: [:gov, :man, :tech], description: 'Nanotechnology' },
|
137
|
+
{ code: 115, group: [:art, :rec], description: 'Music' },
|
138
|
+
{ code: 116, group: [:corp, :tran], description: 'Logistics and Supply Chain' },
|
139
|
+
{ code: 117, group: [:man], description: 'Plastics' },
|
140
|
+
{ code: 118, group: [:tech], description: 'Computer & Network Security' },
|
141
|
+
{ code: 119, group: [:tech], description: 'Wireless' },
|
142
|
+
{ code: 120, group: [:leg, :org], description: 'Alternative Dispute Resolution' },
|
143
|
+
{ code: 121, group: [:corp, :org, :serv], description: 'Security and Investigations' },
|
144
|
+
{ code: 122, group: [:corp, :serv], description: 'Facilities Services' },
|
145
|
+
{ code: 123, group: [:corp], description: 'Outsourcing/Offshoring' },
|
146
|
+
{ code: 124, group: [:hlth, :rec], description: 'Health, Wellness and Fitness' },
|
147
|
+
{ code: 125, group: [:hlth], description: 'Alternative Medicine' },
|
148
|
+
{ code: 126, group: [:med, :rec], description: 'Media Production' },
|
149
|
+
{ code: 127, group: [:art, :med], description: 'Animation' },
|
150
|
+
{ code: 128, group: [:cons, :corp, :fin], description: 'Commercial Real Estate' },
|
151
|
+
{ code: 129, group: [:fin], description: 'Capital Markets' },
|
152
|
+
{ code: 130, group: [:gov, :org], description: 'Think Tanks' },
|
153
|
+
{ code: 131, group: [:org], description: 'Philanthropy' },
|
154
|
+
{ code: 132, group: [:edu, :org], description: 'E-Learning' },
|
155
|
+
{ code: 133, group: [:good], description: 'Wholesale' },
|
156
|
+
{ code: 134, group: [:corp, :good, :tran], description: 'Import and Export' },
|
157
|
+
{ code: 135, group: [:cons, :gov, :man], description: 'Mechanical or Industrial Engineering' },
|
158
|
+
{ code: 136, group: [:art, :med, :rec], description: 'Photography' },
|
159
|
+
{ code: 137, group: [:corp], description: 'Human Resources' },
|
160
|
+
{ code: 138, group: [:corp, :man], description: 'Business Supplies and Equipment' },
|
161
|
+
{ code: 139, group: [:hlth], description: 'Mental Health Care' },
|
162
|
+
{ code: 140, group: [:art, :med], description: 'Graphic Design' },
|
163
|
+
{ code: 141, group: [:gov, :org, :tran], description: 'International Trade and Development' },
|
164
|
+
{ code: 142, group: [:good, :man, :rec], description: 'Wine and Spirits' },
|
165
|
+
{ code: 143, group: [:good], description: 'Luxury Goods & Jewelry' },
|
166
|
+
{ code: 144, group: [:gov, :man, :org], description: 'Renewables & Environment' },
|
167
|
+
{ code: 145, group: [:cons, :man], description: 'Glass, Ceramics & Concrete' },
|
168
|
+
{ code: 146, group: [:good, :man], description: 'Packaging and Containers' },
|
169
|
+
{ code: 147, group: [:cons, :man], description: 'Industrial Automation' },
|
170
|
+
{ code: 148, group: [:gov], description: 'Government Relations' } ]
|
171
171
|
end
|
172
172
|
end
|
173
173
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module LinkedIn
|
2
|
+
module API
|
3
|
+
module NetworkUpdates
|
4
|
+
def network_updates(options = {})
|
5
|
+
get ['v1/people/~/network/updates', options[:selector], options[:attached_object_type]].compact.join '/'
|
6
|
+
end
|
7
|
+
|
8
|
+
def network_update_comments(options = {})
|
9
|
+
network_updates(options.merge attached_object_type: 'update-comments')
|
10
|
+
end
|
11
|
+
|
12
|
+
def network_update_likes(options = {})
|
13
|
+
network_updates(options.merge attached_object_type: 'likes')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/linkedin/base.rb
CHANGED
@@ -6,7 +6,6 @@ module LinkedIn
|
|
6
6
|
@attributes = Hashie::Mash.new attributes
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
9
|
def method_missing(method, *args, &block)
|
11
10
|
return @attributes.send(method, *args, &block) if @attributes.respond_to?(method)
|
12
11
|
super
|
@@ -18,11 +17,15 @@ module LinkedIn
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def client
|
21
|
-
|
20
|
+
Base.client
|
22
21
|
end
|
23
22
|
|
24
23
|
def self.client
|
25
|
-
|
24
|
+
@@client ||= self.reset_client
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.reset_client
|
28
|
+
@@client = LinkedIn.new
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
data/lib/linkedin/client.rb
CHANGED
@@ -5,13 +5,15 @@ module LinkedIn
|
|
5
5
|
include Configuration
|
6
6
|
include API
|
7
7
|
|
8
|
+
HTTP_METHODS = [:get, :post, :put, :patch, :delete, :headers].freeze
|
9
|
+
|
8
10
|
attr_reader :access_token
|
9
11
|
|
10
12
|
def_delegators :@access_token, :expires?, :expired?, :request
|
11
13
|
|
12
14
|
def initialize(options={}, &block)
|
13
15
|
configure options, &block
|
14
|
-
self.access_token ||= self.config
|
16
|
+
self.access_token ||= self.config.access_token.to_s
|
15
17
|
end
|
16
18
|
|
17
19
|
def connection
|
@@ -43,7 +45,7 @@ module LinkedIn
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def method_missing(method, *args, &body)
|
46
|
-
return simple_request(method, args[0], (args[1] || {}), &body) if
|
48
|
+
return simple_request(method, args[0], (args[1] || {}), &body) if HTTP_METHODS.include? method
|
47
49
|
super
|
48
50
|
end
|
49
51
|
|
@@ -85,7 +87,7 @@ module LinkedIn
|
|
85
87
|
|
86
88
|
def url_for(option_key)
|
87
89
|
host = config.auth_host
|
88
|
-
path = config
|
90
|
+
path = config.send("#{option_key}_path")
|
89
91
|
"#{host}#{path}"
|
90
92
|
end
|
91
93
|
end
|