Services/Facebook Examples
| From: | Ward Morris | Date: | Sun, 04 Apr 2010 15:56:25 +0000 |
| Subject: | Services/Facebook Examples | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30437@lists.php.net to get a copy of this message | ||
I've been struggling with integration to Facebook via the PEAR package and
was wondering if anyone has a basic example? I'm past the issues on
installing the package and enabling curl for apache. Currently, I'm getting
'Invalid API Key' back from Facebook, but I've checked and double checked
that the key and secret are correct for my application. In short, all I
want to do is to pull announcements and photos from a Facebook user and
display on an external website.
Here's an excerpt of my code.
// Contains all the includes for application as well as PEAR includes.
include_once '../include_path.php';
try {
$api = new Services_Facebook();
$api->apiKey = '[key]';
$api->secret = '[secret]';
$api->useSessionSecret();
$photos = $api->photos->getPhotosByUser('[uid]');
}
catch (Services_Facebook_Exception $e) {
echo $e->getMessage();
}
Thanks for any help you can offer.
Ward
Ward Morris
email: morris.ward@gmail.com <mailto:mmorris.ward@gmail.com>
cell: (573) 434-1056