<![CDATA[ Adding Facebook Stream/Feed - My Forums]]> https://forums.modx.com/thread/?thread=89285 <![CDATA[Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-490968 Group) to MODX Revo. I want to display the latest 5 posts from the group on my website, but am not sure what the best way of approaching this is - any ideas?? Many thanks]]> Emily Feb 24, 2014, 05:40 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-490968 <![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-562470
There are several ways to integrate Facebook page to your website. You can use standard Facebook plugin, but in my opinion it’s not the best decision ‘cos it’s not fully customizable and looks a bit outdated. I would recommend you to try out this plugin: https://elfsight.com/facebook-feed-widget/. I use it for about a six month and happy with it. You can customize it and place to the site, there is an option “posts limit”, you can use it to show only 5 latest posts.

You can work with images too.

Hope it helps.
]]>
legmisers Nov 01, 2018, 02:38 PM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-562470
<![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-497558
Does anyone have an idea how I can show the full-size image of a post? Not the property "picture" as this is limited to 100px.

Thank you
Gudrun]]>
ggempp May 10, 2014, 09:24 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-497558
<![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491221
I did following, useing Facebook Graph and you need a Facebook Developer Account. Additionally, the FB User has to set the proper access settings, in order to get access to the posts (Below I get the 5 most recent posts) and you need to setup a chunk for displaying the results):

<?php
$contents = $modx->cacheManager->get('facebook_graph');

if($contents === NULL) {

    $access_url = "https://graph.facebook.com/oauth/access_token?client_id=!!!!YOUR CLIEND ID!!!!&client_secret=!!!! YOUR CLIENT SECRET!!!!&grant_type=client_credentials";
    
    $access_token = file_get_contents($access_url);
    $access_token = explode("=", $access_token);
    $access_token = $access_token[1];
    
    
    $url = "https://graph.facebook.com/!!!HERE YOUR FACEBOOK NUMBER!!!!/posts?limit=5&access_token=$access_token&method=GET&locale=de_DE";

    $contents = file_get_contents($url);
    $contents = utf8_encode($contents);
    $modx->cacheManager->set('facebook_graph', $str, 7200);
}

$results = json_decode($contents);

$output = "";


foreach($results->data as $post) {


    $properties = array();
    

    
    $properties["message"] = $post->message;
    $properties["picture"] = $post->picture;
    $properties["link"] = $post->link;
    $properties["source"] = $post->source;
    $properties["name"] = $post->name;
    $properties["caption"] = $post->caption;
    $properties["description"] = $post->description;
    $properties["icon"] = $post->icon;
    $properties["story"] = $post->story;
    $properties["created_time"] = $post->created_time;
    $properties["type"] = $post->type;
    $properties["action_link"] = $post->actions;

    $output .= $modx->getChunk($tpl,$properties);
}

return $output;


Hope it helps
/toni]]>
tonicrot Feb 26, 2014, 08:38 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491221
<![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491202 https://neosmart-stream.de/ some time ago but couldn't get it working that great.]]> fourroses666 Feb 26, 2014, 05:48 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491202 <![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491186 The API Tokens run out and have to be refreshed manually with your Facebook login.

We are using something like that for some Sites:
[[!getFeed? &url=`http://www.facebook.com/feeds/page.php?format=rss20&id=1234567` &tpl=`facebookRowTpl`]]


]]>
m.engel Feb 26, 2014, 03:02 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-491186
<![CDATA[Re: Adding Facebook Stream/Feed]]> https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-490982
I remember a plugin that can push messages to facebook, SimiusPush. Thats the other way around, but it should be depending on the same API. Google it as I can't find it in the repository.

The good news is: It's fairly easy to do that using the facebook API.

The php SDK can be found here:
https://github.com/facebook/facebook-php-sdk

And an official facebook documentation there:
https://developers.facebook.com/docs/reference/php/

For a tutorial ask google. There are plenty of them.

BUT be careful. Tell your client that facebook, twitter, etc are changing their API every once in a while and sooner or later you have to do some additional work (and charge for it smiley ) to keep up with new "features".

I'm head over heals in a project and already behind with MODX related community stuff. If it is not very urgent, I can send you some snippets I wrote about a year ago in about two weeks. I don't want to give them away as they are right now, but If I find the time to clean up some stuff, I'll gladly give he away.

Regards,

pepebe]]>
pepebe Feb 24, 2014, 08:19 AM https://forums.modx.com/thread/89285/adding-facebook-stream-feed#dis-post-490982