As a guy who prefers to use modern stuff like Node.js instead of crappy old PHP, I´m not really a fan of the Facebook PHP SDK. But sometimes you just need to use it – so here´s a basic tutorial for the current Facebook PHP SDK, they bumped it up a major version so i had to try it. It´s a bit weird that they call it “v4-5.0” though. I knew it would be a problem to use the tag “facebook-php-sdk-v4” on github…
Facebook changed their PHP SDK a lot with version 4.0, so i thought you could use a tiny tutorial how to authorize users and how to use the API with the new version. Feel free to comment about any errors or suggestions.
This a follow-up of my recent article about reading the guest list of a Facebook Event created through Facebook Pages. If you want to get the Events (and the attendees) of a User, it´s a bit more work. You need to authorize the User with the permission “user_events”, and you will still just get the Events the user is attending too with the “/events” connection. I spare you the details of creating an app, this is just the authorization code for the PHP SDK:
$facebook->getLoginUrl(array('scope' => 'user_events'))
There is no easy and integrated way to get the guest list of a Facebook Event anymore. You can view the list of “attendees”, but you just get a small box with no possibility to export it without additional tools. Especially with hundreds of people attending, the list that Facebook offers does not help you at all to get an overview: