I have to say that I wanted to create a clean sand box to play in so I bought a SliceHost virtual host to use for development. Incredibly easy and a basic slice good for development is only $20 per month. They say the cost to start a web-based business is dropping by half every two years. With this kind of easy virtual hosting it's got to be dropping faster than that! Within 5 minutes I had an Ubuntu server live with a full LAMP stack installed. Amazing. Do you realize how many hours I've spent formating disks and installing linux over the last 15 years (yes, I started doing linux in 1994).
I bought two books to help climb the API learning curve. Both are helping a lot though are already slightly out of date. They are:
and the excellent reference:
I have two big initial observations:
1. There are very few useful Facebook Applications that I know of;
2. Setting up the Facebook Developer with a new Application is mind-numbingly detailed and complicated
Useful Facebook Applications
I don't know any useful Facebook apps. Do you? There's all sorts of play applications - where have you been, what City should you live in, etc. But what's really useful? By useful I mean one that really uses the social graph to increase the value for the user. I've not seen one yet, but I'm sure they are there. If you know of one I'd appreciate it if you dropped me a note or comment.
Mind Numbing Options
The Facebook New Application page has more configuration settings than you can shake a stick at (as my Grandmother would have said). It's insane! I realize that this is complicated business, but geesh. Anyway, I set up the name (had to do that to create it) and the most important configuration options were on the Canvas tab.
Te Canvas Page URL is the catch all place where the Facebook platform will go to get content to render within a users Facebook page when they are running your application. The Canvas Callback URL is where the majic happens though. That's the calculation engine.
Getting a List of Your Friends
So, the Canvas Callback URL I tossed together does not format or anything - it's just a small extension to the example code they provide.
<?php
require_once 'facebook.php';
$appapikey = 'yourkey';
$appsecret = 'yoursecretkey';
$facebook = new Facebook($appapikey, $appsecret);
echo "<p>Friends:<br>";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 500);
foreach ($friends as $friend)
{
$uids=array($friend);
$fields=array('first_name','last_name');
$users=$facebook->api_client->users_getInfo($uids,$fields);
foreach ($users as $u)
{
$f=$u['first_name'];
$l=$u['last_name'];
print "<br>$f $l ";
}
}
print "</p>";
?>
This little snip of code will go grab a list of up to 500 friends getting their Facebook UserID. Then it gets those users names and prints them.
Of course, this doesn't do anything useful either, but in about an hour total I was able to fiddle around and learn how to pull real data out of Facebook. Not bad for an evening's fiddling.
What have you done with Facebook apps? What would you like to see done?
[ add comment ] ( 3 views ) | [ 0 trackbacks ] | permalink |




( 3 / 238 )
Archives



