Automatically Detect Facebook Activity - facebook

I am an experienced WordPress developer but sadly I have very little experience with Facebook SDK's.
What I am wondering is if it is possible to create code that will detect whenever a user likes a post/page, "unlikes" a post/page, shares a post/page and logs in to the website via Facebook.
I know that if the like, share and login buttons are coded by myself that I can get a response from the events. However I am wanting to add code to my achievements/points plugin that would detect the events from code that is created by someone else, such as a plugin or the website owner so that it can award the user with points/achievements.
I have tried using the "FB.Event.subscribe" event in the JS SDK to hook into events but this has so far been unsuccessful.
P.S. I don't expect a full tutorial or "cut & paste" code, I am simply wondering if it is possible or if I am wasting my time. Any helpful links and/or offers to help will be greatly appreciated.

Related

Facebook app id for website social plugins

I have like/share buttons on my website and am not currently using an appid. Finding information on whether this is a necessity for the above configuration is difficult to confirm. When going through the Facebook app "create" forms, I'm really confused by a lot of the requirements as it seems to be more focused around actual apps rather than websites, which login via fb etc.
In the past I have created an app for one of my other websites and I don't believe there was any verification/submission process at this point (about 2-3 years ago). Reviewing my old app configuration now I can see that it is not "live" - does anyone know whether Facebook implemented this submission process in the last couple of years, and then de-activated any live apps that were created prior to this?
I now want to setup a new app for my new website and I'm unsure what the different 'action types' mean and what I would need to simply use like/share buttons on the website. Could someone give me a quick run down of what I'd need and what they are?
Any other info/tips people can provide would be greatly appreciated. I'm finding that the like/share DO still work without the app, but sometimes the share button doesn't work properly (I have a feeling this is something to do with the app).
Thanks
If you are just using the Social Plugins, you don't need to have a Facebook App ID.
If you want more integration, it will be required. Creating an App ID is like registering your App, wether an iOS or Android App or just a website, so that you can make Graph API calls for it.
The easiest way to register your website is to go the quickstart: https://developers.facebook.com/quickstarts/?platform=web (or https://developers.facebook.com/apps). There you can type a name and follow the steps.
You can then follow the "Sharing best practices" (https://developers.facebook.com/docs/sharing/best-practices#tags) on how to use the App ID. For example, by including an fb:app_id meta tag on your pages.
There is a review process, since last April, but that is only needed if you use permissions for your App. If you just use the plugins, that is not needed.
Can you explain more what is exactly not working?
Update
The time you create a page the Facebook crawler does not know yet what the Opengraph data for that one is. This will happen after the first share, but if you want to ensure it is correct from the first share on, you can force a re-scrape.
This section explains how that works:
https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
When an app triggers a scrape using an API endpoint This Graph API
endpoint is simply a call to:
POST /?id={object-instance-id or object-url}&scrape=true

Show Facebook wall on website

Is there a way to show your facebook wall on a website? I have been looking for days and all I can find is methods of showing ones OWN messages. Im looking for something(script/code) that will show the complete wall including what friends are posting. Is this even possible or is it prohibited by Facebook? I did search there 'developers api site' but couldnt find an anwser to this.
It's possible but you need to build your own custom version as officially facebook doesn't provide any pre-built plugins or code.
You'll have to code a lot of back-end and front-end stuffs. If you're really interested in building something like that, you might wanna consider looking at this script Facebook Wall Script 3.0 with PHP and Jquery
If you want to save time, you might buy that script, do the necessary changes and integrate facebook graph API so it shows data from your fb profile, but if you want build more advance version and have lot of time, then you can build a custom version from scratch.
i don't see the point of show your facebook wall on a website since can have that easily by pointing the user back to your facebook account.
i would suggest you to display a facebook page plugin instead as you can earn some like and it is free of charge.
could you let me know why you want to do that?

Where to begin with using Facebook's PHP SDK to create events?

I want to use Facebook's PHP SDK to create/update/cancel events on our Facebook Page, whenever they are added/modified/deleted within the "calendar of events" database table on our web site.
Where do I even begin with this? I have the SDK installed, but I am having a really hard time figuring out how to register my own custom app and install it to my Facebook user account. I did manage to get an App ID and App Secret, and I also created a minimal canvas and indicated which persmissions the app needs. But, for the life of me I can't figure out how to install the app on my FB user account.
I don't want to make the app available to others, and I don't even want to access it while I'm logged into Facebook. I just want to be able to do something like $fbapi->createEvent() within my own code on my own site.
Also, do I need to have an authenticated Facebook user session/cookie when calling the API to create the event? It seems to me that would eliminate the possibility of creating events via a command-line PHP cron job.
I feel like I am understanding bits and pieces of this, but there are gaps in my understanding and I'm not seeing how all the pieces fit together. Any direction would be immensely appreciated!
First play around with the Graph API Explorer https://developers.facebook.com/tools/explorer so you can understand better how the Graph is used. From there you can then learn about the PHP SDK http://developers.facebook.com/docs/reference/php and how to do the same things you did with the explorer tool. Events are here documented here: http://developers.facebook.com/docs/reference/api/event/

Tweet (or facebook) status update from iPhone with predefined Text

Hey,
sorry to bother you again, but I can't get this to work and would appreciate a working example project.. I try to give my users the possibility to post a short, predefined message from inside my App on either twitter or facebook (both should be available, but it doesn't have to update both on the same action, so one button to "share on facebook", one button to "tweet about it", so if you have a solution for facebook, but not for twitter or vice versa, I'd happily take the solution you have, either facebook or twitter and go on searching for the other one). It's my first time trying to interact with facebook and twitter, so I need something like dummy-proof explanation.
I found MGTwitterEngine but it seems to be hell to get it working. I've found Ben Gottlieb's Twitter OAuth-iPhone bundle, inserted my data, "registered" my app, and stuck with a gray screen on my device.
I'd need a working example of an iPhone App Project, that manages to tweet or update the facebook status of a user (maybe after a short and painless(!) login). Than I'd happily fiddle around myself to get this working, but by now I only find links to Desktop-Applications, examples or demos that won't work out of the box, or expect you to have done this several times before -.-
Thanks for your help, and sorry if that is an easy question, but I can't find the answer I need..
Perhaps the easiest way to be able to publish to a number of different services is ShareKit. This supports sending messages to Twitter, Facebook and a bunch of other services.

Facebook Connect - Add events to an Events Page (not profile)

I have created Facebook pages with an events tab. I am currently trying to add events to this events page via the Facebook connect API but can't work out how do it.
I can add events to my profile no problem.
Can anyone tell me how to add events to a page, is it possible?
Alternatively is there a way I can add an event to my profile and have my page automatically pick up this event (I can't see anything in the settings for this?).
Any help very much appreaciated!
Thanks
C
Current API doesn't support this as far as I can see.
There is an API function which is in beta at the moment (but doesn't seem to be working as
yet) which according to the documentation is designed to publish a post into the stream on the wall of a user, group, page or event, so this should provide the functionality needed.