linkedin-v2 0.1.6 → 0.1.7

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
- SHA256:
3
- metadata.gz: f0da5bfb3a952ea29e4206d3774ff65daf52304a0d1a1a9406fa000cc8ae15d2
4
- data.tar.gz: ae7b26216441c3ee54f0b07786779d5d84366a0c8e50e23bb433b2e457a3b23e
2
+ SHA1:
3
+ metadata.gz: 8991f91ec7f48020a07e2f8d8f6747b0b89825f8
4
+ data.tar.gz: 0572236151c7e6050f031d66f15e0b9cd1599699
5
5
  SHA512:
6
- metadata.gz: ad6eaffa09f54693588bd639bc20a5d1f3cc5419b9de11c32833a75fdeefee64accb98e1c423ac25931a3a1622d592cd45078309f9e24777e588fb96d5056036
7
- data.tar.gz: 5ea69ed70e9dfe486fbfc553844752e1273b6c18cbd9e7f5eeca97139d773757779f5cb9cf9c111325ab8d01d3b0d9c9be0c0185af13ee41b270d92e7a92bbf5
6
+ metadata.gz: fd70c18f6711f4b3a75e5d6d8c9e9a875334c514ac430dfcd8d45dcb043b7a31c9b937eb8d43787b78ce004eab9017bc82ccfe97dcb8e2d13d32ff8bb24c9a59
7
+ data.tar.gz: 3ee7107de0fa6a71100a014696b124c54d3968ac762d09f33b761ec29e2be11e56dedab6ffdb255d74a75038fe90b377c80c44d029e75f2718c9c0b50ca8dab7
@@ -48,7 +48,8 @@ module LinkedIn
48
48
  :organization_search,
49
49
  :organization_page_statistics,
50
50
  :organization_follower_statistics,
51
- :organization_share_statistics
51
+ :organization_share_statistics,
52
+ :organization_follower_count
52
53
 
53
54
  def_delegators :@communications, :send_message
54
55
 
@@ -58,7 +59,10 @@ module LinkedIn
58
59
  :like,
59
60
  :unlike,
60
61
  :comments,
61
- :comment
62
+ :comment,
63
+ :get_share,
64
+ :get_social_actions,
65
+ :migrate_update_keys
62
66
 
63
67
  def_delegators :@media, :summary,
64
68
  :upload
@@ -72,7 +72,7 @@ module LinkedIn
72
72
  def delete(path=nil, body=nil, headers=nil, &block)
73
73
  # @connection.delete(prepend_prefix(path), params, headers, &block)
74
74
  # To be able to DELETE with a body:
75
- reponse = @connection.run_request(:delete, prepend_prefix(path), body, headers, &block)
75
+ response = @connection.run_request(:delete, prepend_prefix(path), body, headers, &block)
76
76
 
77
77
  Mash.from_json(response.body)
78
78
  end
@@ -113,6 +113,15 @@ module LinkedIn
113
113
  get(path, options)
114
114
  end
115
115
 
116
+ # Retrieve Organization Follower Count
117
+ #
118
+ # https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-lookup-api#retrieve-organization-follower-count
119
+ #
120
+ def organization_follower_count organization_urn
121
+ path = "/networkSizes/#{organization_urn}?edgeType=CompanyFollowedByMember"
122
+ get(path)
123
+ end
124
+
116
125
  # TODO MOVE TO SOCIAL ACTIONS.
117
126
  #
118
127
  # # Retrieve comments on a particular company update:
@@ -36,6 +36,16 @@ module LinkedIn
36
36
  get(path, options)
37
37
  end
38
38
 
39
+ # Retrieve Share by ID
40
+ #
41
+ # https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#look-up-share-by-id
42
+ #
43
+ def get_share(options = {})
44
+ id = options.delete(:id)
45
+ path = "/shares/#{id}"
46
+ get(path, options)
47
+ end
48
+
39
49
  # Create one share from a person, organization, or organizationBrand.
40
50
  #
41
51
  # Permissions:
@@ -60,6 +70,15 @@ module LinkedIn
60
70
  post(path, MultiJson.dump(defaults.merge(options)), 'Content-Type' => 'application/json')
61
71
  end
62
72
 
73
+ # Retrieve a Summary of Social Actions
74
+ #
75
+ # https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/network-update-social-actions#retrieve-a-summary-of-social-actions
76
+ #
77
+ def get_social_actions share_urns
78
+ path = '/socialActions'
79
+ get(path, ids: share_urns)
80
+ end
81
+
63
82
  # Retrieves the likes for a specific post.
64
83
  #
65
84
  # @see https://developer.linkedin.com/docs/guide/v2/shares/network-update-social-actions#retrieve
@@ -122,6 +141,7 @@ module LinkedIn
122
141
  #
123
142
  # @option options [String] :urn, specifies activity queried for comments (e.g.,
124
143
  # urn:li:article:123)
144
+ # @option options [String] :parent_comment, specifies the urn of the parent comment
125
145
  # @option options [String] :actor, specifies the entity performing the action. It should b # represented by a urn:li:person:{id} or urn:li:organization:{id} URN.
126
146
  # @option options [String] :message, the text content of the comment.
127
147
  #
@@ -129,15 +149,25 @@ module LinkedIn
129
149
  urn = options.delete(:urn)
130
150
  actor = options.delete(:actor)
131
151
  message = options.delete(:message)
152
+ parent_comment = options.delete(:parent_comment)
153
+
132
154
  body = {
133
155
  actor: actor,
134
- message: {
135
- attributes: [],
136
- text: message
137
- }
156
+ message: { text: message }
138
157
  }
158
+ body.merge!(parentComment: parent_comment) if parent_comment
159
+
139
160
  path = "/socialActions/#{urn}/comments"
140
161
  post(path, MultiJson.dump(body), 'Content-Type' => 'application/json')
141
162
  end
163
+
164
+ # Migrate from Update Keys to Share URNs
165
+ #
166
+ # https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#migrate-from-update-keys-to-share-urns
167
+ #
168
+ def migrate_update_keys update_keys
169
+ path = '/activities'
170
+ get(path, ids: update_keys)
171
+ end
142
172
  end
143
173
  end
@@ -1,3 +1,3 @@
1
1
  module LinkedIn
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.add_dependency "oauth2", "~> 1.0"
24
24
  gem.add_dependency "hashie", "~> 3.2"
25
25
  gem.add_dependency "faraday", "~> 0.11"
26
- gem.add_dependency 'mime-types', '~> 1.16'
26
+ gem.add_dependency 'mime-types', '>= 1.16'
27
27
 
28
28
  gem.add_development_dependency "rake"
29
29
  gem.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linkedin-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Desjardins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-02 00:00:00.000000000 Z
11
+ date: 2019-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: mime-types
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.16'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.16'
69
69
  - !ruby/object:Gem::Dependency
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  requirements: []
257
257
  rubyforge_project:
258
- rubygems_version: 2.7.6
258
+ rubygems_version: 2.5.2
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: Ruby wrapper for the LinkedIn v2 API