linkedin2 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53afff69d2ae4ebe4801018b856843cfdbb79dcf
4
- data.tar.gz: 5cda569cb4d4599fd7278e62a89c875a37010596
3
+ metadata.gz: 51d82563f7f23c803297332556810c2fa753b594
4
+ data.tar.gz: 532a7e6f0df55a6457ce1cb28b965829701c08c3
5
5
  SHA512:
6
- metadata.gz: 554f50425236d75e91952346eefc5d0e24e6791b8ecdfd52eb788c38e953020c860e3b3830058e314a116d30bc2a3ab7ce0720df00b8ae41053a9de626eaecc2
7
- data.tar.gz: 06b76c1fa84cc584c3ef5f8c9d64e03716c079bb138060bf97ed905af63951d8db04d270da8726ccb761db5c1aea052d6cfa21676b14cc2841c6952b5d3556b0
6
+ metadata.gz: f086e6f64a43aa5f06e1ca130a88bc7440c73471d46e520d0eea92c54b99c77eac8fd97129bb58e290de7933b6fa25948172ebc5cea60d3c1b23d5fed70e38f2
7
+ data.tar.gz: 733984079329092eac4517edcc93612f15be4802ebbd6b091005387d64b407d6967afcdac16bf27ed1b676ac8e82aa11ef529ce0f97cd3601f549e28a7e406cf
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format=nested
3
+ --backtrace
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # LinkedIn 2
2
+ [![Build Status](https://travis-ci.org/bobbrez/linkedin2.png?branch=master)](https://travis-ci.org/bobbrez/linkedin2)
3
+ [![Code Climate](https://codeclimate.com/github/bobbrez/linkedin2.png)](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
@@ -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].to_param
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
- get "v1/companies/#{selector}#{fields_string}"
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: %i(gov tech), description: 'Defense & Space' },
25
- { code: 3, group: %i(tech), description: 'Computer Hardware' },
26
- { code: 4, group: %i(tech), description: 'Computer Software' },
27
- { code: 5, group: %i(tech), description: 'Computer Networking' },
28
- { code: 6, group: %i(tech), description: 'Internet' },
29
- { code: 7, group: %i(tech), description: 'Semiconductors' },
30
- { code: 8, group: %i(gov tech), description: 'Telecommunications' },
31
- { code: 9, group: %i(leg), description: 'Law Practice' },
32
- { code: 10, group: %i(leg), description: 'Legal Services' },
33
- { code: 11, group: %i(corp), description: 'Management Consulting' },
34
- { code: 12, group: %i(gov hlth tech), description: 'Biotechnology' },
35
- { code: 13, group: %i(hlth), description: 'Medical Practice' },
36
- { code: 14, group: %i(hlth), description: 'Hospital & Health Care' },
37
- { code: 15, group: %i(hlth tech), description: 'Pharmaceuticals' },
38
- { code: 16, group: %i(hlth), description: 'Veterinary' },
39
- { code: 17, group: %i(hlth), description: 'Medical Devices' },
40
- { code: 18, group: %i(good), description: 'Cosmetics' },
41
- { code: 19, group: %i(good), description: 'Apparel & Fashion' },
42
- { code: 20, group: %i(good rec), description: 'Sporting Goods' },
43
- { code: 21, group: %i(good), description: 'Tobacco' },
44
- { code: 22, group: %i(good), description: 'Supermarkets' },
45
- { code: 23, group: %i(good man serv), description: 'Food Production' },
46
- { code: 24, group: %i(good man), description: 'Consumer Electronics' },
47
- { code: 25, group: %i(good man), description: 'Consumer Goods' },
48
- { code: 26, group: %i(good man), description: 'Furniture' },
49
- { code: 27, group: %i(good man), description: 'Retail' },
50
- { code: 28, group: %i(med rec), description: 'Entertainment' },
51
- { code: 29, group: %i(rec), description: 'Gambling & Casinos' },
52
- { code: 30, group: %i(rec serv tran), description: 'Leisure, Travel & Tourism' },
53
- { code: 31, group: %i(rec serv tran), description: 'Hospitality' },
54
- { code: 32, group: %i(rec serv), description: 'Restaurants' },
55
- { code: 33, group: %i(rec), description: 'Sports' },
56
- { code: 34, group: %i(rec serv), description: 'Food & Beverages' },
57
- { code: 35, group: %i(art med rec), description: 'Motion Pictures and Film' },
58
- { code: 36, group: %i(med rec), description: 'Broadcast Media' },
59
- { code: 37, group: %i(art med rec), description: 'Museums and Institutions' },
60
- { code: 38, group: %i(art med rec), description: 'Fine Art' },
61
- { code: 39, group: %i(art med rec), description: 'Performing Arts' },
62
- { code: 40, group: %i(rec serv), description: 'Recreational Facilities and Services' },
63
- { code: 41, group: %i(fin), description: 'Banking' },
64
- { code: 42, group: %i(fin), description: 'Insurance' },
65
- { code: 43, group: %i(fin), description: 'Financial Services' },
66
- { code: 44, group: %i(cons fin good), description: 'Real Estate' },
67
- { code: 45, group: %i(fin), description: 'Investment Banking' },
68
- { code: 46, group: %i(fin), description: 'Investment Management' },
69
- { code: 47, group: %i(corp fin), description: 'Accounting' },
70
- { code: 48, group: %i(cons), description: 'Construction' },
71
- { code: 49, group: %i(cons), description: 'Building Materials' },
72
- { code: 50, group: %i(cons), description: 'Architecture & Planning' },
73
- { code: 51, group: %i(cons gov), description: 'Civil Engineering' },
74
- { code: 52, group: %i(gov man), description: 'Aviation & Aerospace' },
75
- { code: 53, group: %i(man), description: 'Automotive' },
76
- { code: 54, group: %i(man), description: 'Chemicals' },
77
- { code: 55, group: %i(man), description: 'Machinery' },
78
- { code: 56, group: %i(man), description: 'Mining & Metals' },
79
- { code: 57, group: %i(man), description: 'Oil & Energy' },
80
- { code: 58, group: %i(man), description: 'Shipbuilding' },
81
- { code: 59, group: %i(man), description: 'Utilities' },
82
- { code: 60, group: %i(man), description: 'Textiles' },
83
- { code: 61, group: %i(man), description: 'Paper & Forest Products' },
84
- { code: 62, group: %i(man), description: 'Railroad Manufacture' },
85
- { code: 63, group: %i(agr), description: 'Farming' },
86
- { code: 64, group: %i(agr), description: 'Ranching' },
87
- { code: 65, group: %i(agr), description: 'Dairy' },
88
- { code: 66, group: %i(agr), description: 'Fishery' },
89
- { code: 67, group: %i(edu), description: 'Primary/Secondary Education' },
90
- { code: 68, group: %i(edu), description: 'Higher Education' },
91
- { code: 69, group: %i(edu), description: 'Education Management' },
92
- { code: 70, group: %i(edu gov), description: 'Research' },
93
- { code: 71, group: %i(gov), description: 'Military' },
94
- { code: 72, group: %i(gov leg), description: 'Legislative Office' },
95
- { code: 73, group: %i(gov leg), description: 'Judiciary' },
96
- { code: 74, group: %i(gov), description: 'International Affairs' },
97
- { code: 75, group: %i(gov), description: 'Government Administration' },
98
- { code: 76, group: %i(gov), description: 'Executive Office' },
99
- { code: 77, group: %i(gov leg), description: 'Law Enforcement' },
100
- { code: 78, group: %i(gov), description: 'Public Safety' },
101
- { code: 79, group: %i(gov), description: 'Public Policy' },
102
- { code: 80, group: %i(corp med), description: 'Marketing and Advertising' },
103
- { code: 81, group: %i(med rec), description: 'Newspapers' },
104
- { code: 82, group: %i(med rec), description: 'Publishing' },
105
- { code: 83, group: %i(med rec), description: 'Printing' },
106
- { code: 84, group: %i(med serv), description: 'Information Services' },
107
- { code: 85, group: %i(med rec serv), description: 'Libraries' },
108
- { code: 86, group: %i(org serv), description: 'Environmental Services' },
109
- { code: 87, group: %i(serv tran), description: 'Package/Freight Delivery' },
110
- { code: 88, group: %i(org serv), description: 'Individual & Family Services' },
111
- { code: 89, group: %i(org serv), description: 'Religious Institutions' },
112
- { code: 90, group: %i(org serv), description: 'Civic & Social Organization' },
113
- { code: 91, group: %i(org serv), description: 'Consumer Services' },
114
- { code: 92, group: %i(tran), description: 'Transportation/Trucking/Railroad' },
115
- { code: 93, group: %i(tran), description: 'Warehousing' },
116
- { code: 94, group: %i(man tech tran), description: 'Airlines/Aviation' },
117
- { code: 95, group: %i(tran), description: 'Maritime' },
118
- { code: 96, group: %i(tech), description: 'Information Technology and Services' },
119
- { code: 97, group: %i(corp), description: 'Market Research' },
120
- { code: 98, group: %i(corp), description: 'Public Relations and Communications' },
121
- { code: 99, group: %i(art med), description: 'Design' },
122
- { code: 100, group: %i(org), description: 'Non-Profit Organization Management' },
123
- { code: 101, group: %i(org), description: 'Fund-Raising' },
124
- { code: 102, group: %i(corp org), description: 'Program Development' },
125
- { code: 103, group: %i(art med rec), description: 'Writing and Editing' },
126
- { code: 104, group: %i(corp), description: 'Staffing and Recruiting' },
127
- { code: 105, group: %i(corp), description: 'Professional Training & Coaching' },
128
- { code: 106, group: %i(fin tech), description: 'Venture Capital & Private Equity' },
129
- { code: 107, group: %i(gov org), description: 'Political Organization' },
130
- { code: 108, group: %i(corp gov serv), description: 'Translation and Localization' },
131
- { code: 109, group: %i(med rec), description: 'Computer Games' },
132
- { code: 110, group: %i(corp rec serv), description: 'Events Services' },
133
- { code: 111, group: %i(art med rec), description: 'Arts and Crafts' },
134
- { code: 112, group: %i(good man), description: 'Electrical/Electronic Manufacturing' },
135
- { code: 113, group: %i(med), description: 'Online Media' },
136
- { code: 114, group: %i(gov man tech), description: 'Nanotechnology' },
137
- { code: 115, group: %i(art rec), description: 'Music' },
138
- { code: 116, group: %i(corp tran), description: 'Logistics and Supply Chain' },
139
- { code: 117, group: %i(man), description: 'Plastics' },
140
- { code: 118, group: %i(tech), description: 'Computer & Network Security' },
141
- { code: 119, group: %i(tech), description: 'Wireless' },
142
- { code: 120, group: %i(leg org), description: 'Alternative Dispute Resolution' },
143
- { code: 121, group: %i(corp org serv), description: 'Security and Investigations' },
144
- { code: 122, group: %i(corp serv), description: 'Facilities Services' },
145
- { code: 123, group: %i(corp), description: 'Outsourcing/Offshoring' },
146
- { code: 124, group: %i(hlth rec), description: 'Health, Wellness and Fitness' },
147
- { code: 125, group: %i(hlth), description: 'Alternative Medicine' },
148
- { code: 126, group: %i(med rec), description: 'Media Production' },
149
- { code: 127, group: %i(art med), description: 'Animation' },
150
- { code: 128, group: %i(cons corp fin), description: 'Commercial Real Estate' },
151
- { code: 129, group: %i(fin), description: 'Capital Markets' },
152
- { code: 130, group: %i(gov org), description: 'Think Tanks' },
153
- { code: 131, group: %i(org), description: 'Philanthropy' },
154
- { code: 132, group: %i(edu org), description: 'E-Learning' },
155
- { code: 133, group: %i(good), description: 'Wholesale' },
156
- { code: 134, group: %i(corp good tran), description: 'Import and Export' },
157
- { code: 135, group: %i(cons gov man), description: 'Mechanical or Industrial Engineering' },
158
- { code: 136, group: %i(art med rec), description: 'Photography' },
159
- { code: 137, group: %i(corp), description: 'Human Resources' },
160
- { code: 138, group: %i(corp man), description: 'Business Supplies and Equipment' },
161
- { code: 139, group: %i(hlth), description: 'Mental Health Care' },
162
- { code: 140, group: %i(art med), description: 'Graphic Design' },
163
- { code: 141, group: %i(gov org tran), description: 'International Trade and Development' },
164
- { code: 142, group: %i(good man rec), description: 'Wine and Spirits' },
165
- { code: 143, group: %i(good), description: 'Luxury Goods & Jewelry' },
166
- { code: 144, group: %i(gov man org), description: 'Renewables & Environment' },
167
- { code: 145, group: %i(cons man), description: 'Glass, Ceramics & Concrete' },
168
- { code: 146, group: %i(good man), description: 'Packaging and Containers' },
169
- { code: 147, group: %i(cons man), description: 'Industrial Automation' },
170
- { code: 148, group: %i(gov), description: 'Government Relations' } ]
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
@@ -18,6 +18,10 @@ module LinkedIn
18
18
 
19
19
  profile options.slice(:selector).merge(selector_option)
20
20
  end
21
+
22
+ def search(options={})
23
+ get "v1/people-search?#{options.to_param}"
24
+ end
21
25
  end
22
26
  end
23
27
  end
@@ -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
- LinkedIn.new
20
+ Base.client
22
21
  end
23
22
 
24
23
  def self.client
25
- LinkedIn.new
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
@@ -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[:access_token].to_s
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 %i(get post put patch delete headers).include? method
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["#{option_key}_path".to_sym]
90
+ path = config.send("#{option_key}_path")
89
91
  "#{host}#{path}"
90
92
  end
91
93
  end