Topic-icon Need to display my activity feed from my facebook page to my Joomla

Active Subscriptions:

None
Hello,

Need to display my activity feed from my facebook page in my joomla site. Unable to do this, could you proivde some instructions on how I can do this? Do I have to use graph.facebook.com ? In which case it requires a token and I dont see any place to put this, please somebody help.

JJ
The topic has been locked.
Support Specialist
JJ,
The JFBCFan module will show the admin feed from your Facebook Page in Joomla. You can either use the JFBCFan module or insert {JFBCFan url=http://www.facebook.com/SourceCoast} into any content area of your site. JFBConnect will replace it with the proper code to display the feed.

There are other options available such as showing the Like button, follower avatars, and other stuff, but once you start configuring the JFBCFan module, you should understand a bit more on how it works.

Hope that helps, but if you need anything else, just let us know!
Alex
The topic has been locked.
Active Subscriptions:

None
I have tried what you recommended niether one of them is working.

You can see the result here: tor-web.com/politics/share-join/layout/facebook

Any help would be appreciated.

Here is the code in this facebook page.

FACEBOOK FAN INFO HERE: {JFBCFan url=http://www.facebook.com/SourceCoast}

FACEBOOK FAN INFO HERE: {JFBCFan url=http://www.facebook.com/409991959024354}

Also, at the bottom of the page you can see I tried to use the module which does not work as well.

Url for facebook page in the JFBCFan module is www.facebook.com/409991959024354/

Please advise,

JJ
The topic has been locked.
Support Specialist
JJ,
I incorrectly gave you the tag above, you should use {JFBCFan href=<FAN PAGE URL>}.

However, even with that, you'll run into issues. The JFBCFan module only works with Facebook Pages. You're trying to show the stream from a Group, which is not possible with the standard Facebook 'widgets'. Facebook severely limits what can be done with groups since their content is generally not meant to be public or for a public website. Therefore, there aren't tools to easily display the Groups private information in a public setting, like your website. Last year, Facebook even tried (albeit failed after some uprising) to convert most Groups to Pages.

Unfortunately, there's not a way built into JFBConnect to display the feed from your Group. It's possible this could be coded using the Facebook Graph API, but that would require your own developer to do. We could give some pointers, of course. However, you'd need to ensure you strictly follow Facebook's privacy policies when posting items from your private group to a public setting. Your users may expect privacy of their messages to that group, and it could get sticky (hence, why there isn't a 'ready-made' tool from Facebook to do so).

Again, hope that helps explain,
Alex
The topic has been locked.
Active Subscriptions:

None
Thank you Alex,

I had actually coded it using the graph but the token keeps expiring specially now that they have removed the extended 60 day limit on it, i thought maybe you had some idea on it.

JJ
The topic has been locked.
Support Specialist
JJ,
Gotcha. JFBConnect currently just gets the "short-lived" access token for Facebook. We're looking into the method they recommend for trading that in and getting the long-lived one during the login process. It actually should be a pretty minor change to our code, and we're hoping to have that tested in the next few days. When we have it, it will be part of the next big release, but we'll gladly provide it to you to make in the current one.

That should, with the code it sounds like you already have, let you use the long-lived access token to get the info.

On a side note, what user's token are you using to fetch the group info? Is it your token and you use it for everyone, or is it the current user's token? That may help with some other ideas of things to do.

Thanks,
Alex
The topic has been locked.
Support Specialist
JJ,
Just wanted to get back to this post. You didn't respond to some of the questions above (mainly, what token you're using), but thought I'd try to close it out anyways. We came up with some code for users that are logging in with JFBConnect that will exchange the 'short-lived' (2 hour) access token with a 'long-lived' (2 month) token. You should be able to use this new token with your previous method for getting Group posts either acting as the user, or if you have it hard-coded to use your access-token.

To fetch the long-lived token, please edit the /components/com_jfbconnect/controllers/loginregister.php file. Around line 294, you'll see:
if ($token && $token != $fbClient->getApplicationAccessToken()) // Should always be valid, but caution is good. 
                              $userMapModel->updateUserToken($jUserId, $token);
Replace that block of code with the following:
if ($token && $token != $fbClient->getApplicationAccessToken()) // Should always be valid, but caution is good. 
                { 
                    // get an extended access token 
                    $params['client_id'] = $jfbcLibrary->facebookAppId; 
                    $params['client_secret'] = $jfbcLibrary->facebookSecretKey; 
                    $params['grant_type'] = 'fb_exchange_token'; 
                    $params['fb_exchange_token'] = $token; 

                    $ch = curl_init(); 
                    $opts = array(); 
                    if ($configModel->getSetting('facebook_curl_disable_ssl', false)) 
                        $opts[CURLOPT_SSL_VERIFYPEER] = false; 

                    $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&'); 
                    $opts[CURLOPT_URL] = 'https://graph.facebook.com/oauth/access_token'; 
                    $opts[CURLOPT_RETURNTRANSFER] = true; 

                    curl_setopt_array($ch, $opts); 
                    $response = curl_exec($ch); 
                    curl_close($ch); 

                    $response_params = array(); 
                    parse_str($response, $response_params); 
                    if (isset($response_params['access_token'])) 
                    { 
                        $newToken = $response_params['access_token']; 
                        $userMapModel->updateUserToken($jUserId, $newToken); 
                    } 
                }
That update will exchange the short-lived (~2 hour) token that is normally provided with the long-lived one for 2 months. The JFBConnect user-map table will be updated with the new token so that you can use whatever code you already have and then grab the long-lived token for the user (or yourself) from the #__jfbconnect_user_map table.

Please test and let us know how that goes. a similar update will be in the 4.4 release (August/September timeframe). It will be coded very differently, but will have the same effect of storing the long-lived token in the db for the user.

Hope that helps, and good luck!
Alex
The topic has been locked.