Script using GRAPH API to GET information about each post from any facebook page. Script Shows content of post, likes(only likes not reactions).
Working DEMO: https://mejsik.github.io/Facebook-News-Feed/
v2.2
- Added AJAX HTTP Request which shows dynamicly your page feed
v2.1
- Added Regular Expression to GET link adress(ex.youtube)
v2.0
- Added photos from each post
- Added each post created time
- Added displaying like count
I used angular.js and Facebook Graph API.
feed.js:
var app = angular.module('facebookFeed', []); var pageId = '[PAGE-ID]'; //Your PageID var token = '[APP-ID]]|[SECRET-CODE]'; //Your Access Token // Request below GET every post using Graph API app.controller('facebookFeedControler', function ($scope, $http) { $http.get(`https://graph.facebook.com/${pageId}/?fields=posts.limit(10){message,likes.limit(0).summary(1),created_time}&access_token=${token}`) .then(function (response) { $scope.posts = response.data.posts.data; }); });
NOTE:To get into any data use '{}' ex. {{post.message}} in HTML file.
NOTE: You just need pageID and access token. In near future I will upgrade to show all reactions and comments with reactions.