public function processResponse(array $resp) { $noNew = true; foreach ($resp as $data) { // type cast $data = (object) $data; if (!($savedUpdate = DataObject::get_one('FBUpdate', "UpdateID='" . $data->id . "'"))) { if (!($pubUpdate = DataObject::get_one('PublicationFBUpdate', "FBUpdateID='" . $data->id . "'"))) { // push output echo "Adding Update " . $data->id . "<br />\n"; flush(); ob_flush(); // get extended info // $res = (object) $this->facebook->sendRequest('get', '/' . $data->id)->getDecodedBody(); // die(print_r($res,1)); // create the tweet data object $update = new FBUpdate(); if ($update->updateFromUpdate($data)) { $update->write(); if (!$update->doPublish()) { echo 'Failed to Publish ' . $update->Title . "\n"; } } // set no new flag $noNew = false; } else { // push output echo "Update " . $data->id . " came from the website<br />\n"; flush(); ob_flush(); } } else { // this should only happen during initial population because we should have only got in tweets that are newer than x // push output echo "Already added Update " . $data->id . "<br />\n"; flush(); ob_flush(); } } return $noNew; }