Module: LinkedIn::Api::ShareAndSocialStream
- Included in:
- Client
- Defined in:
- lib/linked_in/api/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.
Instance Method Details
#add_share(share) ⇒ void
This method returns an undefined value.
Create a share for the authenticated user
Permissions: rw_nus
87 88 89 90 91 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 87 def add_share(share) path = "/people/~/shares" defaults = {:visibility => {:code => "anyone"}} post(path, MultiJson.dump(defaults.merge(share)), "Content-Type" => "application/json") end |
#like_share(update_key) ⇒ void
This method returns an undefined value.
(Update) like an update as the authenticated user
114 115 116 117 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 114 def like_share(update_key) path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, 'true', "Content-Type" => "application/json") end |
#network_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve the authenticated users network updates
Permissions: rw_nus
34 35 36 37 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 34 def network_updates(={}) path = "#{person_path(options)}/network/updates" simple_query(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
57 58 59 60 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 57 def share_comments(update_key, ={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/update-comments" simple_query(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
74 75 76 77 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 74 def share_likes(update_key, ={}) path = "#{person_path(options)}/network/updates/key=#{update_key}/likes" simple_query(path, ) end |
#shares(options = {}) ⇒ Object
TODO refactor to use #network_updates
40 41 42 43 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 40 def shares(={}) path = "#{person_path(options)}/network/updates" simple_query(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
127 128 129 130 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 127 def unlike_share(update_key) path = "/people/~/network/updates/key=#{update_key}/is-liked" put(path, 'false', "Content-Type" => "application/json") end |
#update_comment(update_key, comment) ⇒ void
This method returns an undefined value.
Create a comment on an update from the authenticated user
101 102 103 104 105 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 101 def update_comment(update_key, comment) path = "/people/~/network/updates/key=#{update_key}/update-comments" body = {'comment' => comment} post(path, MultiJson.dump(body), "Content-Type" => "application/json") end |