How to post news feed in facebook from my site - ruby-on-rails

I have a site that allows a user to login using their facebook login id through a RPX system. When the user posts a comment in my site, I want it to automatically post the comment on their facebook wall too. How can I do this using Rails?
I've been learning the facebooker plugin for a couple of days and still can't figure out how to do it.
Are there any easy ways to do this? I got the user's facebook email and id from rpx and just want to post something on their news feed/wall, it is just this simple and it already caused me a headache on how to solve this.
Thanks

Ah, Facebook. You're in for some fun.
I'm not sure how RPX works. I know it abstracts the details so it can support multiple social networks.
I've gotten this working using standard Facebook Connect (not RPX). You need to ask the user for the status_update extended permission. Once you get that, you can post status updates with Users.setStatus.
I recommend looking into the RPX documentation to see if they have something similar.

If you will create an RSS feed for each user, that you will be able to use Flog Blog - Facebook RSS service.
It's just a thought. Try it. might work...

Related

Allow users of my web app to post to their personal facebook page

I have read a lot about allowing users to log into my rails app via facebook omniauth, though I would like users, having loggeed in, to be able to post a to their own personal wall by simply clicking a button in my app. Is this possible? I'm not very new to rails but have never integrated facebook functionality and am very new to working with omniauth. I'm not looking for someone to spell out the specifics...just point me in the right direction! Thanks
According to Facebook documentation here and here, publishing a post to user's wall on behalf of the subject user is not allowed. Instead of this, they encourage the sharing ability.
I hope this is helpful.

Post to news feed with Facebook SDK without login in

Is there a way to post on the user wall without having to do login?
Going thought the documentation i can do this but the user has to do login, which i donĀ“t want cause this is a simple app.
I know there is a tutorial in the facebook developers website, because i found it and only later i realize that. Something using "publish_stream" permissions, if someone can point me in the right direction i appreciate.
It is not automatic (which would violate Platform Policy anyway), but you can use the Feed Dialog for this:
https://developers.facebook.com/docs/reference/dialogs/feed/

Integration With Facebook

I've never used the FaceBook SDK before so I'm not sure what I should be using or whether what I'm thinking of can actually be done. But I want to try to integrate some Facebook functionality with my ASP.NET MVC3 application.
What I need to do:
I want to be able to access someone's Facebook account (granted their permission) and allow them to send out invitations to my website. But, when a friend clicks on the link in the invitation message (whether a wall post, PM... whatever), follows through and registers on the site, I want to be able to track that (maybe by appending the ID or username of the this user to the invitation link, and then extract it from the query string when the invited person/friend registers).
Questions:
From what I've read so far and according to this link, what I think I should be using is the Facebook Connect API. Am I right?
Is what I'm trying to achieve actually doable? Basically, can I append the username to the invitation link? Is Facebook okey with that?
Do you have any good resources other than the Facebook Developer Wiki? Share them please!
P.S: I do not want users to login to my website using their Facebook account. I have my own Membership system. I just want to allow them to invite their friends to register at my website and track that. More requirements might arise but for now that is all what I need.
Your help is appreciated!
EDIT:
Ok I went ahead and created some test app using the Developer FB app to do some experiments. One thing I do not understand though...
Canvas Page: The base URL of your app on Facebook.
Canvas URL: Facebook pulls the content for your app's canvas pages from this base URL.
So what exactly is the Canvas URL? From what I understand, it's a URL to a resource (page?) on my website which Facebook can display inside the Canvas Page, is that correct?
yes
Yes
Facebook documentation + facebook developers forum, that should be all for you. Also, as you are using asp.net mvc, facebooksdk discussion will help you also if you use that library. I will stringly recommend to use that library.
Also, it seems, you are a beginner on facebook api with c#. If so, you can consider my blog post for beginners on facebook open graph api tutorial in c#. There also some other related posts also.Hope you may like them.
Let me know if you wanted to know something else also specifically.
Yes
Yes
Nope. The Developer Wiki has its issues but the Facebook Docs usually solve your problems.

Simple Facebook API usage in Rails 3

I want to connect my app to Facebook in order to post on the user's wall. I want the user to click to post a message on his Wall, the pop-up of the js SDK should appear, he would login and authorize and get redirected to the home page as the pop-up disappears.
I was trying the fb_graph gem but had some hard troubles and I want to know: Is there a simpler way to do it?
Note that I don't want to make the user able to login in my app with Facebook, just post to his wall.
As Facebook does not offer any Ruby API, you will have to choose between using the JS SDK or implementing a Facebook share link.
If you only want to post in the user's wall, I recommend the second option because of ease and nature. You can customize the content of the post this way.
If you decide to go the JS way, you will have to:
Create a FB app.
Include FB SDK into your page.
Initialize the SDK with your app settings.
Ask for permissions to the user in order to post into her wall.
Assign a button to a function where you check for login. If she's already logged, show a window to post into the wall (FB popup or your own form, as the iframe dialogs are only available inside Facebook pages).
There is another alternative to step 5 by using Graph API and an access token, but it's a little bit more complicated and I don't recommend it if you are new to FB development.
I think, essentially, it's all or nothing when it comes to Facebook authentication. You're asking for permission to take over the user's identity and post on their Facebook wall - there will definitely be some kind of authentication and user approval. It's not a totally trivial process.
I'm sure you've looked already, but if you are OK using any of the social plugins that Facebook offers (http://developers.facebook.com/docs/plugins/), that might be an easier option to achieve what you're looking for.
If not, you'll have to gain a user's permission and post on the wall the way Facebook describes on their site. There's another gem, called Koala (https://github.com/arsduo/koala) that is pretty easy to use as well, but you can also take a look through the fb_graph documentation and see which pieces of code are applicable to your needs and duplicate that functionality.
The best source of information is on Facebook's site (http://developers.facebook.com/docs/reference/api/), where they describe the process in detail:
You can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs, using an user access token or an app access token (for Open Graph Pages).
and
Most write operations require extended permissions for the active user. See the authentication guide for details on how you can request extended permissions from the user during the authentication step.
The first time I looked at this stuff I was totally overwhelmed, but play around with it and it will make a lot more sense.
I just saw #manuelpedrera 's answer, and that's a good step-by-step guide. Short answer: there's no shortcut.
Koala is a Facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), the REST API, realtime updates, test users, and OAuth validation.
Take a look at Koala gem: https://github.com/arsduo/koala

Rails - How to access Facebook wall posts of a user

I am building a Rails site for a friend. It is mainly going to be a static website with a few exceptions. On the homepage I would like to display the latest Facebook wall posts from a Facebook user's profile, that way my friend can post a status update on Facebook and it will be reflected on the homepage of the website. What would be the best way to go about implementing this? Should I be using the Facebook Graph API or be looking for a Facebook Ruby gem or is there some other way of doing this? Can someone please tell me what I should use to do this task? Thanks!
you may look into http://facebook-ruby.sourceforge.net/ or http://rfacebook.rubyforge.org/

Resources