<?php

require_once './includes/facebookFeeder.php';
$facebookFeeder = new facebookFeeder();
$facebookFeeder->profile_id = '255822004558294';
$facebookFeeder->app_id = '1653623468222616';
$facebookFeeder->app_secret = 'e51ce96edf1b953eeb9c97d2f68c3b41';
//avail fields: https://developers.facebook.com/docs/graph-api/reference/v2.0/post
$facebookFeeder->fields = 'message,caption,name,link,full_picture,picture,description';
$facebookFeeder->limit = '20';
$feed = $facebookFeeder->getFeed();
echo $feed;
 private function getFacebookFeed()
 {
     /*temporary simulation*/
     // $data = file_get_contents ('./fb-simulate-timeline.json' );
     // echo $data;
     // exit;
     /*end simulation*/
     require 'includes/facebookFeeder.php';
     $facebookFeeder = new facebookFeeder();
     /*Connected Learning*/
     $facebookFeeder->profile_id = '255822004558294';
     $facebookFeeder->app_id = '1653623468222616';
     $facebookFeeder->app_secret = 'e51ce96edf1b953eeb9c97d2f68c3b41';
     //avail fields: https://developers.facebook.com/docs/graph-api/reference/v2.0/post
     if (isset($_POST['fields'])) {
         $facebookFeeder->fields = $_POST['fields'];
     }
     if (isset($_POST['limit'])) {
         $facebookFeeder->limit = $_POST['limit'];
     }
     $feed = $facebookFeeder->getFeed();
     echo $feed;
     exit;
     //$this->jsonSend  = $feed;
     //$this->sendJson();
 }