Facebooker Tutorial
Next Lesson → News Feed
3.1) Mini Feed
This lesson covers the Facebooker Publisher Api and shows how to send a message to a user's Mini-Feed. When you publish a story to the Mini-Feed, there is also a chance that the story will be published to friends of that user that have also added the app. See Feed.publishActionOfUser for more details.
-
I am pretty sure that the permissions around the the Mini Feed, require that the user hass added the application. Put this call at the top of the controller.
Note: Facebook will fail silently if the user has not added the app
ensure_application_is_installed_by_facebook_user
-
Create a class that extends Facebooker::Rails::Publisher. You can put this class anywhere but Rails will auto load it if you put it in RAILS_ROOT/lib.
1 2 3
#File: lib/facebooker_publisher.rb class FacebookerPublisher < Facebooker::Rails::Publisher
-
Define a method that will handle your Mini Feed message.
This method can take any number of arguments. For a Mini Feed you typically would need
to pass in the user that the message is for. You must set which user's Mini-Feed is being published to with the from method.
It is best if the first line in you method indicates which type of
message to publish to Facebook, in this case this is done via "send_as :action".
The Publisher instance that gets created is a proxy for each of the Facebooker messaging types. You can look at the code or documentation so see what methods are supported. The following options are supported by "send_as" and the class to look at for available methods.
1 2 3 4 5 6 7 8 9 10
#File: lib/facebooker_publisher.rb Method: mini_feed def mini_feed(user) send_as :action self.from( user) title "just learned how to send a Mini-Feed Story using Facebooker." body "#{fb_name(user)} just checked out the #{link_to("Facebooker Tutorial", :controller => "messaging", :action => "mini_feed")} Mini-Feed lesson." image_1(image_path("fbtt.png")) image_1_link(outline_path(:only_path => false)) RAILS_DEFAULT_LOGGER.debug("Sending mini feed story for user #{user.id}") end
- :action => Facebooker::Feed::Action
- :story => Facebooker::Feed::Story
- :templatized_action => Facebooker::Feed::TemplatizedAction
- :email => Facebooker::User send_email method
- :notification => Facebooker::Session send_notification method
- Now you can deliver your Mini-Feed news item by calling deliver_<method>
1 2 3 4 5 6 7
#File: app/controllers/messaging_controller.rb Method: test_mini_feed def test_mini_feed FacebookerPublisher.deliver_mini_feed(facebook_session.user) flash[:notice] = "Check your Mini-Feed in a little while. You should see a news item from Facebooker." redirect_to(:action => "mini_feed") end
Test Mini Feed Now!
Next Lesson → News Feed
Comment Section for Mini Feed


Srikanth PagadalaFeb 23, 2009
Thanks for great plugin.
One feature request (i have posted the same on sourceforge feature request page too).
http://wiki.developers.facebook.com/index.php/Mobile
fb mobile is relatively new, which is somehow completely missing from facebooker.
if you check out the above url there are supposedly two new apis
1) sms.send(uid uid, string message, i32 session_id, bool req_session)
2) sms.canSend(uid uid)
I think SMS support should be part of facebooker publisher apis. Any chance of putting in a patch?
Thanks
Sriks
Daniele BonifaziFeb 18, 2009
That kind of notification doesn't require a session, I'm new to Facebooker and I'm stuck, I need to send app_to_user notifications from cron_jobs . Can you help me ?
Adam Berlinsky-SchineJan 17, 2009
Elías Emilio Orozco ChagüiJan 15, 2009
Helmut FritzJan 15, 2009
Mario TatisJan 15, 2009
ensure_authenticated_to_facebook
def index
FacebookerPublisher.deliver_mini_feed(session[:facebook_session].user)
@blogs = Blog.search(params[:search], params[:page])
end
.
.
.
end
Mario TatisJan 15, 2009
Thanks for the tutorial!
i'm having some problems with the mini_feed method. i always get this error
StandardError in BlogsController#index
This method is deprecated
Srikanth PagadalaNov 2, 2008
David ClementsNov 1, 2008
It is in the PeepCode book, you can get it for 9 bucks if you can't wait for some help on the tutorial.
Srikanth PagadalaNov 1, 2008
David ClementsOct 28, 2008
Forrest GrantOct 28, 2008
David ClementsAug 15, 2008
http://rubyforge.org/pipermail/facebooker-talk/2008-August/000913.html
I don't konw the full details yet.
Gray NoodleAug 14, 2008
Prabha PattabiramanAug 13, 2008
David ClementsAug 12, 2008
I am not sure what you mean about configuring your app for receiving. I wouldn't even try that until you can get a simple email from your application to a standard email account. Also check your spam folder and make sure it isn't landing there.
Birba RaniAug 12, 2008
Ivan Acosta-RubioJul 5, 2008
Brad HubbardMar 19, 2008
Facebooker::Session::SessionExpired (Session key invalid or no longer valid):
Any clues?
Jorge MiramontesMar 11, 2008