This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Facebook Graph manipulation Symfony Bundle (get PageId, Picture, RssFeed ...)

dev-master 2014-03-17 09:49 UTC

This package is auto-updated.

Last update: 2021-11-09 07:43:29 UTC


Want to get the PageId, the PageFeed, the page picture or anything else ? You're in the right place

Please add this bundle to your project with to composer :

php composer.phar require appventus/facebook-graph-bundle:dev-master

Then declare it in your AppKernel by adding this line :

new AppVentus\FacebookGraphBundle\AppVentusFacebookGraphBundle(),


Sometimes, you need the page id (for example to get the rss feed with the url :

$facebookGraphParser = new AppVentus\FacebookGraphBundle\Parser\FacebookGraphParser('AppVentus');
$pageId = $facebookGraphParser->getParam('id');

To continue the rss example, sometimes you need to get the RSS Feed :

$rssReader = new FacebookPageRssReader($festival->getFacebookPageId());
$festival->feed = $rssReader->getFeed();

Then you'll have a FacebookFeed Object containing the title, link, description and all the items (FacebookFeedItem composed by a title, a description, a link, a publication date and a author). So in your custom twig view, you could display them like this :

    <a href="{{ }}">
        <img src="{{ facebookPictureUrl #See next example # }}">
    {{ feed.title }}</small>
<ul class="facebook-feed-items">
{% for item in feed.items %}
    <li class="row">
        <em>{{ item.publishedAt|date('d/m/Y') }}</em>
            {{ item.description|raw }}
        <a href="{{ }}">Voir le post direct sur Facebook</a>
{% endfor %}

Sometimes, you need the page picture :

$facebookGraphParser = new AppVentus\FacebookGraphBundle\Parser\FacebookGraphParser('AppVentus');
$facebookPictureUrl = $facebookGraphParser->getFacebookPicture(35, 35);

Feel free to fork and add your own needs, it's more fun together ;)

Bitdeli Badge