Free Gifts App gives the Gift of Its Source Code (via Pastie)

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: , ,

You can Bookmark this entry on del.icio.usbookmark this, digg this entrydigg this or check the See this page in technoraticosmos

9 Responses to “Free Gifts App gives the Gift of Its Source Code (via Pastie)”

  1. Gravatar Icon 1 hash 

    wow! Nice find Shanti.

  2. Gravatar Icon 2 andy 

    Great work!!!

    If only we had the config files as well…

  3. Gravatar Icon 3 Zach 

    Not even close to the entire code, even the majority of the fbml is fb:refs.

    I sent you an email.

  4. Gravatar Icon 4 Shanti A. Braford 

    @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.

  5. Gravatar Icon 5 Zach 

    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!

  6. Gravatar Icon 6 Michael Mrozek 

    I like the hardcoded API key use like 5 lines after the use of the constant

  7. Gravatar Icon 7 Zulfiqar Ali Soomro 

    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

  8. Gravatar Icon 8 Zach 

    one billion dollars.

  9. Gravatar Icon 9 Zulfiqar Ali Soomro 

    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.


Shanti A. Braford blogs here.

If you really want to know, just read this.



  

Powered by FeedBlitz