Facebook Page Feed with graph API using PHP

Get Facebook Page Feed with graph API using PHP & MySQL

Get Facebook Page Feed with graph API using PHP & MySQL

Facebook is on of the top social networking platform among the people. Facebook provides its API for developers to enhance creativity and productivity. Today, I will discuss its graph API to get Facebook page Feed with graph API using PHP & MySQL without any authentication. This script can be used on console, on live website or even on localhost.

Prerequisite:

  • Facebook page URL
  • Facebook application ID
  • Facebook secret code
  • The good knowledge of PHPmySQL

I am sharing the process to create the Faceboo app. Kindly, do follow these steps.

First, we will create a Facebook App. Click Here

Create Facebook application

Step 2: Select website as a platform

image-2

Step 3: Write your application name and click Create New Facebook App ID button.

image-3

Step 4: Select settings for application and give your email.

image-4

Step 5: Skip quick start

image-5

 

Step 6: App setup from sandbox to live on review page

image-6

Final Step for application creation and setting: Copy application ID and Secret from settings page

image-7

Coding for your feed application

database.sql

Database Connection

config.php
Update the config file as per your credentials.

index.php

Inedx.php file requires application unique id or page name of your facebook

feed.php

The main file which is used to get page info and feeds and store in database.

This file will get latest 25 posts of your given page and store in database and display them on view.php file attached in download source code.