Facebook graph api for PHP resources! - php

I am creating a little flash game for the facebook platform, but I am finding it very difficult to get any decent documentation on the graph api and the PHP SDK, so if anyone has a decent resource for a beginner to go and learn the basics, I would appreciate it very much, as I am struggling to grasp the concept.
Thanx!

I agree that the docs can be pretty hard work for facebook. If you are looking to use the Graph API tho, bear in mind that it is just a REST API that uses oAuth for authentication, much the same as Twitter, SoundCloud etc.
The most awkward bit I found was authenticating properly so I would suggest checking out the oAuth website
http://oauth.net/
They also have some PHP samples which were what I used as a starting point. I'd definitely recommend starting from these rather than trying to build your own setup from scratch.
http://oauth.googlecode.com/svn/code/php/
I also found it handy to refer to the docs on some of the other sites that use oAuth, such as Twitter and SoundCloud as it helped build my overall understanding of what is going on, even if there were a few small differences from one site to another
http://apiwiki.twitter.com/Authentication
http://wiki.github.com/soundcloud/api/02-authentication
Personally I would suggest just trying to do a basic oAuth-authenticated request to begin with. Facebook Graph has a few extra options such as using scope for extended permissions. Whilst you will probably need to use these in the end, once you get your head round the signing mechanism its easy enough to add in these extra details.
Once you have got the hang of signing requests, it is just a case of requesting the appropriate endpoint for what you want using either curl or any other method that takes your fancy.
Hope this is of some use

Related

oAuth and that bio-digital jazz

So, i'm a fairly beginner in oAuth and i'm wanting to write a simple wrapper for Tumblr since i'm craving to make an iPad HTML5 App.
The thing is, i can't seem to find any clear documentation on how to exactly set up everything for oAuth-php. I can make a two legged request, and it works... but i want to be able to save users (three-legged) and retrive their dashboards (and i need need to make a GET request with authorized credentials).
I'm clueless on where to start.
Here's a somewhat vague documentation on the Tumblr API: http://www.tumblr.com/docs/en/api/v2#user-methods
This document helped me quite a bit to get the whole authorization header stuff worked out: http://oauth.net/core/1.0a/

OpenID and FB Connect Tutorial

Simple question really, I've been looking all over the Internet probably for the past few days for several hours a day looking for some solid information on OpenID and Facebook Connect integration on a website.
I have seen the same names popup such as Janrain offering their solution, but I see a lot of websites such as Invision Power Board forums and even here at StackOverflow utilising different solutions.
The main two logins we wish to accept on our site are Facebook and Twitter. I've really been looking for a tutorial, or at least a guide to incorporating this functionality into a PHP website.
If anyone has any information or any pointers that would be great.
Thanks!
I'd start with the official docs. They're pretty good.
http://developers.facebook.com/docs/authentication/
http://dev.twitter.com/pages/sign_in_with_twitter
The twitter one is a little more obtuse, but it's still pretty easy to follow.
For Twitter, just use their simple JavaScript SDK:
http://dev.twitter.com/anywhere/begin
But I would really avoid implementing these services myself. E.g. Twitter anywhere is maybe painless to setup, but then you rely on their JavaScript. It's been down before and then your page takes ages to load or doesn't load at all.
I haven't tried the new Facebook APIs, but 2 years ago, I wasted a way a week of my life trying to integrate their API and the general idea I got was -- unless you know someone at Facebook that can check out some log or let you know why this API doesn't respond like it's supposed to, you're just on your own.
We do use Janrain's engage product (free). It works really, really well.
Dealing with all these services directly is a royal (!) PITA. They are down, change how they work, mis-behave -- it's good to outsource that to someone who seems to know all the ins and outs. In our case Janrain.
There's a copy and paste Facebook login button solution out there. It's also free. It's developed by LaunchBit. You could try that.
http://toolkit.launchbit.com

Need help with basic Twitter implementation in PHP

I once had a decent implementation of my Twitter feed on my website but apparently Twitter's authentication has changed and all my functionality is broken. All I need to do is retrieve my timeline, including tweets and retweets - nothing fancy, not an app, nothing.
I'm having a terribly hard time finding any resources to help me do this. I need things spelled out for me clearly and concisely, which none of the tutorials I've found (especially on Twitter) seem to do. Can anybody help me? Please?
Thanks,
Mike
Twitter now uses oAuth for their API authentication. You can find a large number of PHP oAuth frameworks/libraries out there that should be able to facilitate your needs. I have used twitteroauth by Abraham Williams. You can find it easily enough on GitHub.

Where can I find examples of code similar to how Remember the Milk uses the Twitter API?

I'm nearly finished building a simple web application that would really benefit from integration with Twitter through its API. I think the best way to do this would be through following and direct messages similar to how RTM has chosen to interact with users through Twitter. I learn best by analyzing examples, so I would like to find some good examples that illustrate how to use the Twitter API for interaction with users. Thank you.
My web application uses PHP and MySQL.
This is a pretty good article / set of examples for using the PEAR Services_Twitter library to do a bunch of different twitter actions including direct messages and following.
Using the Twitter API with PHP and PEAR: http://devzone.zend.com/article/4431
It is a year old though, so it doesn't use OAUTH. To find an example of that, check out the documentation:
http://pear.php.net/package/Services_Twitter/docs/latest/Services_Twitter/Services_Twitter.html
The Twitter API supports cUrl, so you can use that library to send the necessary headers and retrieve the data you require. A good example here:
http://applicationdeveloper.net/2009/07/12/post-twitter-curl/

how to get last x facebook message + answer with php?

Is there a way to get my latest facebook message +comments to show on my own website?
I would recommend looking into Facebook Connect, which provides API's for exactly the functionality you're looking for.
Facebook has fairly well-documented developer resources; you can get started at http://developers.facebook.com/, which should lead you to a few options for what you want to do. In the deeper integration stuff, PHP integration is pretty well-supported, so you should be able to find good information.
Once you've gotten a handle on the general structure of their API/Connect framework, the specific information you need is in their dev wiki documentation for Message (FQL).

Categories