dev-master
9999999-devUsefull sevices for integration Newscoop and Facebook
GPL-3.0
The Requires
- php >=5.3.3
- ext-curl *
- kriswallsmith/buzz >=v0.9
- newscoop/plugins-installer >=v0.2
by Pawel Mikolajczuk
cms facebook newscoop integration
Usefull sevices for integration Newscoop and Facebook
In the Newscoop server console, run the command: ``` bash $ php application/console plugins:install "newscoop/facebook-newscoop-bundle" --env=prod, (*1)
This plugin will be installed to the `newscoop/plugins/Newscoop` directory. ### Step 2: Go to an article edit page in Newscoop to see the Facebook Plugin on the right sidebar. Also read more about [Lifecycle Subscriber Managing](https://wiki.sourcefabric.org/display/NPS/Lifecycle+Subscriber+Managing). **Database table for the plugin** This plugin has only one entity: `Facebook.php`. After the plugin is installed, your Newscoop database will have a new table: `plugin_facebook_informations`. This table keeps information from Facebook about an article, such as: - `article` - article ID - `language` - article's language ID - `title` - article title - `description` - article description - `created_at` - date when information was added - `is_active` - information status **Generating Open Graph tags using a Smarty plugin** In the `Newscoop/FacebookNewscoopBundle/Resources/smartyPlugins` directory you will find the file: `block.facebook_meta_block.php` This file is a Facebook metadata block plugin. It generates the Facebook Meta information for a page. The Smarty plugin will be automatically autoloaded and available in your templates. To test and display metadata generated by the Smarty plugin just put this block into `_html-head.tpl`: ```` {{ facebook_meta_block admins="123422,234223432,234234234,23423423" }}{{ /facebook_meta_block }} ```` The Smarty plugin will generate HTML code, for example:
//ex. , (*2)
You can read more about Open Graph tags in the [Facebook developer docs](https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/). **Submitted and scheduled for publication articles on Facebook** This plugin provides a special treatment for articles which have not yet been published. The URI has this format: ```/f/+{webcode}``` For example: ```/f/+j6gd4``` and can be found in the plugin's sidebar widget in the article editor. ![Screen](http://i58.tinypic.com/2rzyp2t.png) By default only simple HTML structure with Open Graph meta tags will be rendered for the Facebook crawler. You can override this with the ```__fb_submited_article.tpl``` template file included in your template. Example template output:
, (*3)
```, (*4)
When you enter the article edit screen in Newscoop, the plugin will check if there is already information about that article in the database. If not, it will connect to Facebook Graph API and download all necessary information. Next, that information will be inserted into the Newscoop database., (*5)
If connection to Facebook is a success, the status message on Screen 1 will show up., (*6)
, (*7)
Screen 1: General Plugin view., (*8)
To clear the article cache, just click the Clear article cache on Facebook
button and a message will show up (look at Screen 2)., (*9)
, (*10)
Screen 2: Connecting message after button click., (*11)
If for some reason connection to Facebook isn't possible, we will see an error message (look at Screen 3), (*12)
, (*13)
Screen 3: Connection to Facebook failed - status message., (*14)
This plugin is released under the GNU General Public License v3. You can read the complete license in the source., (*15)
The Facebook plugin for Newscoop is a Sourcefabric z.Ăș. initiative., (*16)
Usefull sevices for integration Newscoop and Facebook
GPL-3.0
cms facebook newscoop integration