This document discusses an internal tool called fb-research that can mass message on Facebook. It summarizes the technical details, including that it uses Ubuntu 11.10, PHP, Symfony, Apache, MySQL, MongoDB and Google Docs. It also provides code snippets for customizing the tool's Facebook authentication and API access. The document encourages hiring designers and offers the ability to license the fb-research system as a SaaS product.
11. About Engineering
lib/FacebookUtil.class.php
public function getMe() {
if (empty($this->access_token)) $this->getAccessToken();
$graph_url = 'https://graph.facebook.com/me?access_token=' . $this->access_token;
$this->me = json_decode($this->crawler->curlCached($graph_url));
}
public function getFriends($uid = '', $sub_query='') {
if (empty($this->me)) $this->getMe();
if (empty($uid)) $uid = $this->me->id;
$fql = 'SELECT id, name FROM profile WHERE id IN (SELECT uid2 FROM friend WHERE uid1=' . $uid.')' . $sub_query;
$graph_url = 'https://api.facebook.com/method/fql.query?query='
. rawurlencode($fql) . '&access_token=' . $this->access_token.'&format=json';
$friend_arr = json_decode($this->crawler->curlCached($graph_url));
return $friend_arr;
}