X
Business

Video: a Facebook Like button built out of Lego

The LikeLight is a Facebook Like button built out of Lego that lights up whenever the Like count on a given Facebook object increases. You have to see it for yourself.
Written by Emil Protalinski, Contributor

Advertising agency Red Pepper has developed the LikeLight: a Facebook Like button built out of Lego. You can see it in action in the video embedded below.

Ever since Facebook opened up its Graph API, developers have been given access to all sorts of new data metrics. In this case, the LikeLight can use the Like count for any Facebook object.

Here's how it went down. First, the company ordered a custom Lego set from Lego's Design by Me webpage to build the shell. Four LEDs were then wired to the Arduino logic board, which in turn was linked up to an Arduino Ethernet Shield (to get an Internet connection for sending and receiving data online).

Some PHP code, below, was then implemented so that the Arduino could interact with the aforementioned API. The script, at redpepperlab.com/likelight, can return the number of Likes of any Facebook Page, though right now it's pulling in Lil Wayne's.

$jsonurl ="https://graph.facebook.com/LilWayne"; $json = file_get_contents($jsonurl); $json_output = json_decode($json); $likes = 0; if($json_output->likes){ $likes = $json_output->likes; } echo '?='.$likes;

The result is a LikeLight that lights up whenever Lil Wayne's Facebook Like count increases on his Facebook Page. Unsurprisingly, that happens every second.

Editorial standards