Class: LinkedIn::ShareAndSocialStream
- Inherits:
-
APIResource
- Object
- APIResource
- LinkedIn::ShareAndSocialStream
- Defined in:
- lib/linked_in/share_and_social_stream.rb
Overview
Share and Social Stream APIs
The following API actions do not have corresponding methods in this module
- GET Network Statistics
- POST Post Network Update
Instance Method Summary collapse
-
#add_share(share) ⇒ void
Create a share for the authenticated user.
-
#like_share(update_key) ⇒ void
(Update) like an update as the authenticated user.
-
#network_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve the authenticated users network updates.
-
#share_comments(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve all comments for a particular network update.
-
#share_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve all likes for a particular network update.
-
#shares(options = {}) ⇒ Object
TODO refactor to use #network_updates.
-
#unlike_share(update_key) ⇒ void
(Destroy) unlike an update the authenticated user previously liked.
-
#update_comment(update_key, comment) ⇒ void
Create a comment on an update from the authenticated user.
Methods inherited from APIResource
Constructor Details
This class inherits a constructor from LinkedIn::APIResource
Instance Method Details
#add_share(share) ⇒ void
This method returns an undefined value.
Create a share for the authenticated user
Permissions: rw_nus
84 85 86 87 88 |
# File 'lib/linked_in/share_and_social_stream.rb', line 84 def add_share(share) path = "/people/~/shares" defaults = {visibility: {code: "anyone"}} post(path, defaults.merge(share)) end |
#like_share(update_key) ⇒ void
This method returns an undefined value.
(Update) like an update as the authenticated user
110 111 112 113 |
# File 'lib/linked_in/share_and_social_stream.rb', line 110 def like_share(update_key) path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, "true") end |
#network_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve the authenticated users network updates
Permissions: rw_nus
31 32 33 34 |
# File 'lib/linked_in/share_and_social_stream.rb', line 31 def network_updates(={}) path = "#{profile_path()}/network/updates" get(path, ) end |
#share_comments(update_key, options = {}) ⇒ LinkedIn::Mash
The first 5 comments are included in the response to #network_updates
Retrieve all comments for a particular network update
Permissions: rw_nus
54 55 56 57 |
# File 'lib/linked_in/share_and_social_stream.rb', line 54 def share_comments(update_key, ={}) path = "#{profile_path()}/network/updates/key=#{update_key}/update-comments" get(path, ) end |
#share_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Some likes are included in the response to #network_updates
Retrieve all likes for a particular network update
Permissions: rw_nus
71 72 73 74 |
# File 'lib/linked_in/share_and_social_stream.rb', line 71 def share_likes(update_key, ={}) path = "#{profile_path()}/network/updates/key=#{update_key}/likes" get(path, ) end |
#shares(options = {}) ⇒ Object
TODO refactor to use #network_updates
37 38 39 40 |
# File 'lib/linked_in/share_and_social_stream.rb', line 37 def shares(={}) path = "#{profile_path()}/network/updates" get(path, {type: "SHAR", scope: "self"}.merge()) end |
#unlike_share(update_key) ⇒ void
This method returns an undefined value.
(Destroy) unlike an update the authenticated user previously liked
123 124 125 126 |
# File 'lib/linked_in/share_and_social_stream.rb', line 123 def unlike_share(update_key) path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, "false") end |
#update_comment(update_key, comment) ⇒ void
This method returns an undefined value.
Create a comment on an update from the authenticated user
98 99 100 101 |
# File 'lib/linked_in/share_and_social_stream.rb', line 98 def update_comment(update_key, comment) path = "/people/~/network/updates/key=#{update_key}/update-comments" post(path, {comment: comment}) end |