0

I am using like-box plugin for pages and i want to use into my website.

Here's the code that i got from developer/facebook

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like-box" data-href="https://www.facebook.com/manchesterunited" data-colorscheme="light" data-show-faces="false" data-header="false" data-stream="true" data-show-border="false"></div>

Can i custom this plugin or can i get only the text from this plugin. More specifically, i want to show the status updates one by one, and changing every second in p tag!!

ah92
  • 307
  • 5
  • 20

2 Answers2

0

The facebook social plug-ins can only be customised in a very limited manner by choosing the colour scheme options etc on the Facebook developer page at:

https://developers.facebook.com/docs/plugins/like-box-for-pages/

You can do some minor styling using a div wrapped around the facebook injected code and utilising things like overflow controls and background colours - but that wouldn't get close to changing the way the content is displayed.

It sounds like to achieve what you're looking to do you'd need to utilise the opengraph API and write some custom code to retrieve the likes / feed and style from there.

Following comments below -

You can do it relatively easily in either PHP or JS. Facebook have SDK's for both that do the heavy lifting for you right out of the box. The hardest task really is some parsing of JSON and knowing the right URL to call...

This is pretty good tutorial on how to do it using the Javascript API: http://tutorialzine.com/2011/03/custom-facebook-wall-jquery-graph/ (using jquery, rather than pure javascript but covers the fundamentals).

PHP wise: This SO post has a good example: Facebook PHP SDK 3.0 - How to get my page wall posts at any time?

Community
  • 1
  • 1
steve
  • 2,469
  • 1
  • 23
  • 30
0

You can't get only plain text from the Facebook Like Box plugin and it's very difficult to customize these plugins.

You will need to use the opengraph API and get de JSON of the posts of your page. For example, I tryied to get the stackoverflow facebook page with the API explorer:

https://developers.facebook.com/tools/explorer?method=GET&path=stackoverflowpage%2Fposts

To use the graph API you will need a valid access token and the id or name of the page:

/page_id/posts

Then, you need to get the request data with a JSON parser and show the data as you want.

pekpon
  • 761
  • 1
  • 10
  • 24