Posting something that happened to Facebook through an HTML Button - facebook

I've looked through several tutorials on using the Facebook API, but none of them address what I'm trying to do.
I'm working on a website for a small college. When the user applies online, they would like it to redirect to a page with a link that will put a post on your Facebook wall that says, "Billy just applied to Awesome State College" with a link to apply and an image of some sort (probably the school's logo).
I guess it would be similar to the way Facebook games throw up posts, saying "Gertrude just clubbed 300 baby seals in 'Clubbing Baby Animals Pro'!" But I wouldn't need to create a whole new Facebook app for this, would I?

Posting on a user's wall requires an access token, which you can get with the help of
one of Facebook SDKs, which will need your app id.
Reference for posting on user's wall:
http://developers.facebook.com/docs/reference/api/
See section Publishing.
You can use Facebook Javascript SDk as the need is simple:
http://developers.facebook.com/docs/authentication/client-side/

Related

Facebook Like button for one facebook page of an app from it's own ios app

I am looking for Like Button to be shown in my ios native app, users of that app have already connected to app via facebook account.
there are several questions related to Facebook Like Button on stackoverflow but those are not specific to authorized single facebook page of the app.
According to official doc of facebook, facebook pages can not be liked via built-in action o open graph api.
But want only one official facebook page of that app to be liked by user when he hits like button. i don't want user to navigate away from the app or login again in web view to like facebook page.
is it possible to like app's facebook page without promoting user to log in again in webveiw?
Edit
Findings
1. https://stackoverflow.com/a/5837036/1632984
2. Comment by wallacer
"the general consensus does seem to be that you can't like a page on behalf of the user, however I just had an ios game like a page on my behalf. Extreme Road Trip successfully manages to get you to like their own page. I wish I'd paid more attention when I did it now..." – wallacer
This still can't be done directly using the graph api ( to the best of my knowledge ). What you can do is open a webview to the page you want the user to like. If you're rewarding their liking your app or something, when they close the webview (you'll have to provide a close button), you can use the graph api to check whether they like your app page. As far as I can tell this is the best current solution - and seems to be the approach taken by mobile games.
That said, I haven't used Facebook SDK 3 yet, so there may be something in there that could help you.
It appears that Liking a page on behalf of a user is still impossible. I've glanced over the iOS SDK Reference, and it doesn't seem like there is a built in mechanism to like anything.
However, in reading one of the other posts you linked to, and remembering that Facebook opened up the Like open graph action so app developers could allow their users to like content generated by their application...I found this link about built-in-actions (likes).
According to that link, you can post Like actions to your users by POSTing to https://graph.facebook.com/<user_id>/og.likes with the POST params for object (the open graph object URL you want to like on behalf of the user in this case your page's url. eg. www.facebook.com/yourpage) and access_token (obviously, for your user).
I'm not totally convinced that will work; though it is conceivable. My second thought would be to create an Open Graph Object for your page, and have all your users like that. Though, that is a little less ideal, as it removes the possibility of people finding your Page while they're on Facebook and would require you to put a lot more effort into getting likes for the Page via your website, application, etc.
I hope that helps a bit, good luck.

Code for inviting friends

I need a code for inviting friends to a fanpage.
http://developers.facebook.com/docs/reference/dialogs/requests/
This is linking to the website. Is it possible to link to my fb fanpage?
Actually if you read the whole documents, that Request feature is for Facebook Application only. But here's a work around :
Create a Facebook Application
Have a great content where everyone wants to have
Put a Like Gate before they can access your great content
You can still use the App Request for your app while the user likes your page

How to make wall posts made by users on app's facebook page

Is there anything I need to do to make posts users make on their wall via a custom ios application using it's own facebook app id, also appear on app's (facebook app it uses I mean) own facebook page?
I would expect this to appear automatically but it doesn't seem to be the case.
In order to read one's Facebook wall, you need the access token to authenticate reading. This will give you access to all non-public wall posts. From this, you can pass the newly posted content to your page through the feed action.
Reference: http://php-academy.blogspot.com/2011/04/how-to-post-from-facebook-app-to.html
Enjoy and good luck!

Which app do I need to display facebook feed?

I need to display the "wall posts" from Facebook page to another website's social media wall.
The problem is that I never used neither Facebook nor any other social networks and got no clues on how do they work. That's why I'm pretty confused with API and it's terms.
The API docs say that I need a pageId for the page I'd like to display and appId and appSecret to get an access token to the feed.
I understand how to get the token and how to parse the results - but what kind of Application do I need for that? Should I create a facebook profile and make an application that would generate me these app codes? Or ask a page's owner to do it?
I spent quite a time googling but it must be something too obvious to write about it in docs? Help please?
The administrator of the facebook page is the only one that has access to the posts on the page wall.
For the APP:
The application can be created in any facebook verified account - go to: https://developers.facebook.com/apps and create the new app - this will give you the app id and secret.
Use the Facebook SDK that you feel most comfortable with to develop the app.
For the wall posts: There are several Graph API requests for wall posts in the form of:
https://graph.facebook.com/[pageid]/[call] where [call] can be posts, statuses, feed, home. See http://facebook.stackoverflow.com/questions/6214535/what-is-the-difference-between-feed-posts-and-statuses-in-facebook-graph-api for details about each.
Using an access token (that you said you already know how to get) the administrator of the page will be able to call the above URLs and get the wall posts.
For the part with posting the info on another social media website you have to specify the exact environment where you want the wall posts to end up.

How to auto-publish wordpress post to facebook fanpage without a facebook app?

My aim is to make a facebook fanpage for a client who wants his blogposts to automatically show up on his fanpage.
I've already read several posts here in the forums. I've tried several methods to auto-publish wordpress posts to a fanpage in facebook.(notes, ...) The last method I used was making an app and using the "Simple Facebook Connect" plugin for wp.
I got quite confusing with this. I have an app called "myClient" and a fanpage called "myClient". If I publish a blogpost, it automatically shows up on the fanpage but "via myClient". Is there a way on get rid of the facebook app? I don't want to show up the via-sentences because the app is just the connection between wp and fb and has no content at all (the content is on the fanpage)
Hopefully you can help me with that!
Thanks in advance.
Whenever you want to publish something on Facebook, you need a Facebook Application as it's the "trusted" connection between your source and Facebook (this is why you have the App Secret and all the authentication/authorization process..etc).
So, How to auto-publish wordpress post to facebook fanpage without a facebook app?
You can't! But what you can do is changing the App name to something the Client would agree on (and not being "already taken", of course!).
You can use the notes facility available. It is updated when the RSS address you provide updates.
Actually there is a way to get rid of the Facebook App - by using third parties automatic Facebook publishing tools like ZapRobot - in that way you actually lean on someone else's FB API APP. Note that then you give "manage_pages" permission to the third party. The process should be:
1) Register with ZapRobot - this is a Facebook login, you give them posting rights to your page
2) Define a job that posts A LINK (ignore their categories) while the link is pointing to the RECENT wordpress item on your blog
Good luck :-)