Allow users of my web app to post to their personal facebook page - ruby-on-rails

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.

Related

Automatic login on facebook from my site

I am working on a web application, I am using graph API with php sdk for accessing the facebook features.
I am using facebook connect and it is working fine for login, but every time a user come to my site and get login by using the login button.
I want to make this automatic, Is there any way that when users come to my site they get logged in automatically.
How can I achieve this..
anybody help please.
thanks in advance.
Danish
If the user does not explicitly authorize you to get some private data from his Facebook account (included his Facebook ID), you can not get them.
I cannot think of a way to get the Facebook ID without the authorization of the user. So no way for you to automatically log in users.
Hope that helps.
I would say that maybe you shouldn't make it to connect automatically, some viewers of your website might not be very happy that as soon as they get there they are automatically logged in with their facebook profiles, pictures, information, etc.
Also because there could be another one's facebook already connected on the same computer, but still...
My advice would be to just leave a button to login when the user wants.

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

How to Post to twitter wall from my website

I'm building an application where users post their tips on various topics on my website.
While posting their tips - I've recently implemented the option where they can post that tip to their facebook wall as well.
They simply check the box - saying "Post to Facebook" and then the facebook pop-up opens up where they login and publish the tip to their facebook wall.
Now I want to add the new functionality where they can post it to their twitter feed as well directly from my website.
Are there any tutorials that show how to implement this.
Thanks
The first place to look for all things Twitter-API related: the Twitter API Wiki. Also take a look at the Twitter Dev Portal.

How to post news feed in facebook from my site

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...

Resources