GIVEAWAY? HOW FAIR WAS IT?

Our first Facebook giveaway was successful! We almost reached the number we were hoping for, 92 out of 100 and we decided to run it a bit early.

How did we do it? With the help of a computer, sheesh. Stonge-age much?

This is where it gets semi-nerdy... OK, a lot nerdy.

If you're logged in to facebook with appropriate credentials you can access the facebook API. You could develop the entire thing using OAUTH for your application to log you in, but in this case, it was much easier to access the link and save the data.

DATA URL: https://graph.facebook.com/944092175604662/likes?limit=1000

By loading up the data url in a web browser it will display the JSON data requested. In our case, 'likes' with the page ID of 944092175604662 and declaring 1000 results limit.

I then simply save this data to be referenced later from our 'Whizbang Winner Generator'. I named the file likes.json.

On to the 'Whizbang Winner Generator'!

Here is my PHP to read the JSON data and select a random winner, pretty sexy, I know. The code is iffy, but I don't care, it worked.