2017 © Pedro Peláez
 

contao-bundle contao-facebook-import

Facebook posts and events for Contao Open Source CMS

image

mvo/contao-facebook-import

Facebook posts and events for Contao Open Source CMS

  • Monday, May 14, 2018
  • by m-vo
  • Repository
  • 2 Watchers
  • 7 Stars
  • 106 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 9 Versions
  • 36 % Grown

The README.md

contao-facebook-import

This bundle enables to use Facebook's events and posts as native elements in Contao Open Source CMS. The following things are available:, (*1)

  • Automatic and on-demand import of Facebook events and posts
  • Image scraper that automatically downloads high resolution images*) of posts and events into Contao's filesystem
  • Content Elements to display events and posts
  • Support for multiple Facebook pages simultaneously, (*2)

    *) Note that the largest size of images being used will be smaller or equal the maximum size set in the Contao settings. (The system tries to download the biggest possible file with this constraint.), (*3)

Version 3

This is version 3 of the bundle - to see a list of changes and information on how to migrate from older versions please refer to the changelog., (*4)

PHP 8

Unfortunately, there is no official release of facebook/graph-sdk with support for PHP 8. You can, however, require the third-party fork nickdnk/graph-sdk in your application, which added support for PHP 8 and acts as a drop-in-replacement. You might want to do this before installing this bundle, so that the installation won't fail., (*5)

$ composer require nickdnk/graph-sdk

Setup

Step 1: Download (& register) the Bundle

Require the bundle as a dependency and register the MvoContaoFacebookImportBundle in your AppKernel (automatically done in the Contao Managed Edition):, (*6)

$ composer require mvo/contao-facebook-import

Update your database., (*7)

Step 2: Configure (optional)

You can edit the configuration by setting the following parameters in your config.yml - the following values are the defaults:, (*8)

mvo_contao_facebook_import:
    request_limit_per_node: 150
    request_window_per_node: 3600
    max_execution_time: 16
    trigger_type: 'internal'
  • request_limit_per_node defines the maximum amount of requests that will be issued in a certain time (request window) to prevent exceeding the API limits - this limit is calculated individually for every defined Facebook node., (*9)

  • request_window_per_node defines the length of the request window in seconds. The evaluation happens on a scrolling window basis., (*10)

  • max_execution_time defines the maximum execution time in seconds that the synchronization process is allowed to run. Setting this value to a bigger value (that your server is still capable to do) will offer a quicker image synchronization., (*11)

  • trigger_type defines how the synchronization should be triggered. By default (internal) the Contao cron system is used but you can set it to route. The process can than be started by calling the /_sync_fb_nodes route. If you want to limit the synchronization a specific node you can pass the node id as an optional get parameter., (*12)

    Example to trigger synchronizing node 5:, (*13)

    wget https://mydomain.org/_sync_fb_nodes?node=5
    

Its highly recommended to use a distinct cron job and use the route. If you use the internal variant make sure you have disabled the periodic command scheduler and you are still triggering the _contao/cron route with a cron job. Otherwise long latency might occur when the synchronizer is running., (*14)

Step 3: Use the Bundle

Facebook GraphAPI, (*15)

Create one or more Facebook nodes in the backend. To make your application able to connect to Facebook's GraphAPI, you need to create a at least one Facebook app and access token., (*16)

The latter you can generate doing the following steps: * Open the Graph API Explorer * Select your app from the App dropdown. * Select your page from the Get Token dropdown (under Page Access Tokens) - you'll therefore have to allow the app to access your page. * Paste the generated token into the facebook node's field in the backend. * Check the belongside checkbox (convert token) and save the record - the system will then try to generate a token that won't expire anymore and replace it with the one you entered., (*17)

To test your token and see if it won't expire, you can enter it into the Access Token Debugger and look for the expiry date., (*18)

Synchronization, (*19)

If you enable auto synchronization, you're good to go. To manually import posts and events, see what got imported or hide certain elements head to the respective posts / events child views of your Facebook node., (*20)

Images are being imported separately from the textual contents in the background. Their import happens in chunks and is prioritized over updating the textual content. You'll see images appearing in the elements as soon they have been scraped., (*21)

Frontend, (*22)

To display the data in the frontend use the Facebook Post List and Facebook Event List content elements., (*23)

The Versions

14/05 2018

dev-master

9999999-dev

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

14/05 2018

v2.2.1

2.2.1.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

15/04 2018

v2.2.0

2.2.0.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

15/04 2018

v2.1.1

2.1.1.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

14/04 2018

v2.1.0

2.1.0.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

13/04 2018

v2.0.0

2.0.0.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

03/01 2018

1.1.2

1.1.2.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

13/09 2017

1.1.1

1.1.1.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import

11/09 2017

1.1.0

1.1.0.0

Facebook posts and events for Contao Open Source CMS

  Sources   Download

MIT

The Requires

 

The Development Requires

social posts events facebook contao import