Method: Facebooker::User#publish_to
- Defined in:
- lib/facebooker/models/user.rb
#publish_to(target, options = {}) ⇒ Object
Publish a post into the stream on the user’s Wall and News Feed. This post also appears in the user’s friend’s streams. The publish_stream extended permission must be granted in order to use this method.
See: wiki.developers.facebook.com/index.php/Stream.publish
target can be the current user or some other user.
To publish to a Page on the Page’s behave, specify the page id as :uid and set :post_as_page to ‘true’, use the current user as target
Example:
# Publish a message to my own wall:
me.publish_to(me, :message => 'hello world')
# Publish to a friend's wall with an action link:
me.publish_to(my_friend, :message => 'how are you?', :action_links => [
:text => 'my website',
:href => 'http://tenderlovemaking.com/'
])
147 148 149 |
# File 'lib/facebooker/models/user.rb', line 147 def publish_to(target, = {}) @session.post('facebook.stream.publish', (target, ), false) end |