2017 © Pedro Peláez
 

symfony-bundle facebook-graph-bundle

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

image

appventus/facebook-graph-bundle

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

  • Monday, March 17, 2014
  • by lenybernard
  • Repository
  • 4 Watchers
  • 3 Stars
  • 72 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

FacebookGraphBundle

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

Please add this bundle to your project with to composer :, (*2)

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

Then declare it in your AppKernel by adding this line :, (*3)

new AppVentus\FacebookGraphBundle\AppVentusFacebookGraphBundle(),

Examples

Sometimes, you need the page id (for example to get the rss feed with the url https://www.facebook.com/feeds/page.php?id=YOUPAGEID&format=rss20) :, (*4)

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

To continue the rss example, sometimes you need to get the RSS Feed :, (*5)

$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 :, (*6)

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

Sometimes, you need the page picture :, (*7)

$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 ;), (*8)

Bitdeli Badge, (*9)

The Versions

17/03 2014

dev-master

9999999-dev http://appventus.com

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

  Sources   Download

MIT

The Requires

 

facebook graph