
The Facebook App Free Gifts is quite the viral application.
I’m not sure if this was intentional or not, but pretty much the entire application is available for perusal / download via pastie, a tool commonly used by developers to share code snippets.
Some of the app code mirrored below:
// includes
require_once('/fbExchange/code/fbApps/coreLib/globalConfig.php'); // hard code to live config file, NOT beta!
require_once('facebook.php'); // from coreLib
require_once('/fbExchange/code/fbApps/freegifts/lib/lib.php'); // needs total rewrite
//Some facebook stuff
$facebook = new Facebook($api_key, $secret);
$facebook->require_frame();
$appUrl = "http://apps.facebook.com/freegifts";
$callbackUrl = "http://freegifts.fbexchange.com";
...
//Determine the page
if (isset($_GET['to']) && isset($_GET['from']))
$page = "giftToGift";
else if (isset($_GET['from']))
$page = "sentGifts";
else if (isset($_GET['to']))
$page = "receivedGifts";
else if ($_GET['action'] == "single")
$page = "singleGift";
else if ($_GET['action'] == "valentines")
$page = "valentines";
else if ($_GET['action'] == "track")
$page = "track";
else if ($_GET['action'] == "stats")
$page = "stats";
else if ($_GET['action'] == "settings")
$page = "settings";
else
$page = "default";
Update: Zach from Free Gifts sent me a note explaining the situation. I’ve removed my mirror. This kind of thing can happen to the best of us. It’s also just a small portion of the app, not the entire thing.
I stumbled across the code via this Google search.
A little word to the wise: don’t pastie your entire application’s code… unless you intend for it to be open source, that is. ![]()
Tags: facebook, facebook apps, free gifts
Shanti A. Braford blogs here.
If you really want to know, just read this.




wow! Nice find Shanti.
Great work!!!
If only we had the config files as well…
Not even close to the entire code, even the majority of the fbml is fb:refs.
I sent you an email.
@andy - lol
@Zach - gotcha. thank you for your contribution to the fb ecosystem, albeit unintentionally =)
i wish there were more open source fb apps, especially RoR.
Thanks Shanti! Stupid mistake on my part.
I am always open to helping out / answering questions about the facebook platform and how I use it, so feel free to ask!
I like the hardcoded API key use like 5 lines after the use of the constant
I need this free gift application source code. Could some one please give me the code. If you charge for it how much is the price. Please do let me know today
one billion dollars.
That was good. Well i am serious. I need facebook gift application source code. Please tell me how much will you charge. I need it please.