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(update_key, options = {}) ⇒ Object
-
#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
91 92 93 94 95 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 91 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
118 119 120 121 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 118 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
33 34 35 36 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 33 def network_updates(={}) path = "#{person_path()}/network/updates" simple_query(path, ) end |
#share(update_key, options = {}) ⇒ Object
44 45 46 47 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 44 def share(update_key, ={}) path = "#{person_path()}/network/updates/key=#{update_key}" 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
61 62 63 64 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 61 def share_comments(update_key, ={}) path = "#{person_path()}/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
78 79 80 81 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 78 def share_likes(update_key, ={}) path = "#{person_path()}/network/updates/key=#{update_key}/likes" simple_query(path, ) end |
#shares(options = {}) ⇒ Object
TODO refactor to use #network_updates
39 40 41 42 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 39 def shares(={}) path = "#{person_path()}/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
131 132 133 134 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 131 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
105 106 107 108 109 |
# File 'lib/linked_in/api/share_and_social_stream.rb', line 105 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 |