inkrement / facebookfeed

octobercms plugin to load facebook feed
https://octobercms.com/plugin/inkrement-facebookfeed
GNU General Public License v2.0
3 stars 3 forks source link

Set other queries with your plugin #1

Open queengab opened 7 years ago

queengab commented 7 years ago

Hi Christian,

i 'm trying to figure out how to extend your old facebook feed plugin. I'm trying to use it like a base to create standard queries extracted from the graph api tool explorer.

For example:

` public function info(){

    $AppId = 'value';
    $AppSecret = 'value';

    FacebookSession::setDefaultApplication(
        $AppId, 
        $AppSecret
    );

    $session = FacebookSession::newAppSession();

    $request = new FacebookRequest(
    $session,
    'GET',
    '/fbpageID',
    array(
    'fields' => 'ratings.limit(5){review_text,reviewer},access_token'
  )
);

    $response = $request->execute();
    $reviews = $response->getGraphObject()->asArray()['data'];

    return json_decode($reviews);
}`

I have simplified the code and tried to show all rating and tet reviews of a given page without using settings and declaring my variables directly on it. When i try to launch the code the plugin returne me 'This call requires a Page access token.' How can i pass also page access token. Which facebook sdk used this plugin? Exist some updates?

I'm trying to embed in the plugin this query fundamentally: pageid?fields=access_token,ratings.limit(5){review_text,reviewer,has_review}

Have some suggestions? Bye Gab

inkrement commented 7 years ago

Sry, but I haven't looked at the code or coded OctoberCMS-plugins for years.