Mention Facebook Page - ruby-on-rails

I am using Koala to post on my Facebook wall and I would like to mention a page. But the following doesn't work:
#graph.put_wall_post("This page rocks: #[1466840030227949]")
Any way to do this with Koala? And without Koala?

I know this is old, but this answer may help someone else who ends up here.
the syntax above is correct with Koala. To mention a Facebook Page you need to include #[page-id] in the message parameter.
To use Page Mentioning with any Facebook Page, your app need to have been granted the manage_pages and publish_actions permissions. Your app will also need approval for the Page Mention feature.
There is a way to test this without being approved for the permission or feature but please check out my related question and the Facebook docs for more information on how to do that.

Related

Alternative to Facebook read_stream

Is there an alternative to allowing the permissions of some sort rather then 'read_stream' permission in Facebook, for a user to read or an app pull their Facebook feed or home feed?
It's very hard, if at all, for Facebook to approve the 'read_stream' permission, so I'm looking for an alternative steps to still allow for our users to pull their favorite stories in our rails app. Any suggestions?
There is no alternative. You can use user_status to get the status posts of the authorized user with /me/statuses.
Btw, it´s not only "hard" to get read_stream approved, it´s nearly impossible ;) - but for very good reasons. Apps should not get access to posts of users who did not even authorize the App.
edit: There is also user_posts now, as replacement for read_stream: https://developers.facebook.com/docs/apps/changelog#v2_3_new_features
Did some investigation. And it is possible.
Instead of the feed you need to access the endpoint /me/posts
This API is accessible with either read_stream or user_posts permission.
https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-user_posts
See here for more information:
https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed
It is quite hidden, but if you know where to look you can find the docs.

Facebook app permissions

I have an iOS app which posts to Facebook on behalf of the user logged in through the iOS Facebook setting.
Two problems -
the posts are marked private, the users friends don't see them.
The iOS app want to be able to harvest Like and Comment info but I get back a 400 from FB.
Here's the wrinkle, my Facebook account works perfectly (posts are visible to friends and I can get the Like and Comment info), but a test user account will post only as private and the iOS app gets a 400 when trying to get post info.
The attached screen shots show the different permissions (top for tester, bottom for me) but I can figure out what to ask Facebook for at login to get the same permissions for both users. Currently I'm asking for publish_actions and user_status.
Any help would be much appreciated!
You need to make sure you are asking for public_profile also you need to make sure you split your permission access into two pieces, as per FB, 1) read 2) write
Just follow the login process on the Facebook Dev page, this will allow you to outline your permissions the right way. Also make sure your test user is added into the groups on your Facebook Dev portal.
Also can you provide any code of what you have tried?
Turns out the post_id element was not what I wanted but rather the id. After that I could use json to get the comments and likes. So the call was almost correct.
And adding stream_read to the permissions got the post to be visible to friends...
Thanks for all the help!

Linking Twitter account to new company page on FB returns error message

I created a company page on FB a few days ago linked to my personal account, but I got this error as I was trying to link my Twitter account to the company page. The Twitter account linked fine to my personal account page, but gave the following error when I tried to link to company page...
"ERROR:This endpoint has been deprecated.To temporarily reenable it,you may disable the "august_2012" platform migration. It will be disable permanently on August 1,2012."
I saw a post about this problem on Stack Overflow at Facebook error while linking: how to fix?
But I didn't understand the fix suggested by Igy:
"You can get help from Facebook for user / account / site problems at facebook.com/help/?page=220217228006012 - this is not the correct forum for those questions (see facebook.stackoverflow.com/faq#questions for more information) – Igy 13 hours ago"
I went to both the links Igy provided but couldn't find anything having to do with this issue.
Sorry I am not a coder. In the next life. Can anyone help?
The reply is saying that you can get help for your Facebook user, Facebook account or Facebook site at the link provided. This website is not for general Facebook help which you have. Please visit the link and you can find the answer you are looking for by searching there.

Post with Twitter API and PHP

I am new to Twitter API and in twitter in general so I have some questions. I have a web site and I want to add a button for sharing a message (for example "Hello World", taken from my site) to a user's twitter page.
First of all I have created an application in twitter, call myTwitterApp and I want to post through this. When the user clicks the button I want to see the authentication page, for login, and then after login I want to see my message inside the editable input, being able to be changed my the user. And finally I want the user to post it by clicking the tweet button, but continue saying that the post was "via myTwitterApp".
Does anyone have an idea how to do it or how to search about it?
Thanks in advance.
I have some experience with the twitter api lately, but not comprehensively. so I can only give you some kind of direction, and hopefully this will help you. So the idea is that you should understand how the Oauth protocol works, steps like requestToken->accessToken->api calls. there is a tutorial for beginners here http://oauth.net/documentation/getting-started/, you shold take a look. if you have manage to go through the oauth authentication, then you should be able to call the POST method which you can post contents to Twitter. you can search for Twitter oauth api, there are a bunch of them online. grab one and use it.

In rails, how can I import a user's facebook contacts when they sign up?

I have a signup form, and I wanted to make it so that they have the option of recommending this signup to all their friends in facebook.
Is there a rails API/gem for doing this?
Is there an appropriate name for this?
Thanks!
Looking at the Extended permissions documentation, you don't get access to the email addresses of a Facebook user's friends (search for email and note the second column reads not available). If that's what you're trying to achieve, it's almost certainly not possible, without the user contacting each friend and asking them to visit your app (which I would imagine would have quite a low take-up, if only through inertia).
I guess you have two options:
popup a javascript before submitting the form to prompt the user wether he wants to share it with friends. You will use the js api http://github.com/facebook/connect-js (see the dialog section). This solution would avoid doing server side connection to the facebook api
Have a look a the Facebooker gem to do a stream_publish

Resources