{"id":37262931,"url":"https://github.com/xmhafiz/fb-page-feed","last_synced_at":"2026-01-15T23:24:37.208Z","repository":{"id":38106272,"uuid":"86176051","full_name":"xmhafiz/fb-page-feed","owner":"xmhafiz","description":"Simple PHP package to get any Facebook Page posts","archived":false,"fork":false,"pushed_at":"2023-04-19T19:44:58.000Z","size":126,"stargazers_count":66,"open_issues_count":2,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-20T15:42:11.429Z","etag":null,"topics":["facebook-graph-api","facebook-page","fb-page-feed","hacktoberfest","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xmhafiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-25T17:35:48.000Z","updated_at":"2025-10-09T01:56:32.000Z","dependencies_parsed_at":"2024-06-19T16:34:44.621Z","dependency_job_id":null,"html_url":"https://github.com/xmhafiz/fb-page-feed","commit_stats":{"total_commits":60,"total_committers":7,"mean_commits":8.571428571428571,"dds":0.5333333333333333,"last_synced_commit":"0b18eac34494a67dce7575f6be0eff3d73ae0612"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/xmhafiz/fb-page-feed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmhafiz%2Ffb-page-feed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmhafiz%2Ffb-page-feed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmhafiz%2Ffb-page-feed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmhafiz%2Ffb-page-feed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmhafiz","download_url":"https://codeload.github.com/xmhafiz/fb-page-feed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmhafiz%2Ffb-page-feed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["facebook-graph-api","facebook-page","fb-page-feed","hacktoberfest","php"],"created_at":"2026-01-15T23:24:36.697Z","updated_at":"2026-01-15T23:24:37.202Z","avatar_url":"https://github.com/xmhafiz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get Facebook Page Feed \n\n[![Build Status](https://travis-ci.org/xmhafiz/fb-page-feed.svg?branch=master)](https://travis-ci.org/xmhafiz/fb-page-feed)\n[![Coverage](https://img.shields.io/codecov/c/github/xmhafiz/fb-page-feed.svg)](https://codecov.io/gh/xmhafiz/fb-page-feed)\n[![Packagist](https://img.shields.io/packagist/dt/xmhafiz/fb-page-feed.svg)](https://packagist.org/packages/xmhafiz/fb-page-feed)\n\nIt is simple wrapper class written in php to fetch posts from certain Facebook page.\n\nCurrently I am using [Facebook graph API](https://developers.facebook.com/docs/graph-api) with cool [guzzle](https://github.com/guzzle/guzzle) and [dotenv](https://github.com/vlucas/phpdotenv)\n\nTested in PHP 7.0, 7.1, 7.4, 8.0\n\n## Requirement\n- PHP 7.0+\n\n## Installation\n\n#### Step 1: Getting Facebook App\n- Go to [Facebook developer](https://developers.facebook.com/apps/) website\n- Click \"Add a New App\" and fill in details\n- On your **Dashboard**, get the \"App ID\" and \"App Secret\"\n- Yeah, you are ready to code\n\n#### Step 2: Install from composer\n```\ncomposer require xmhafiz/fb-page-feed\n```\nAlternatively, you can specify as a dependency in your project's existing composer.json file\n```\n{\n   \"require\": {\n      \"xmhafiz/fb-page-feed\": \"^1.2\"\n   }\n}\n```\n\n## Usage\nAfter installing, you need to require Composer's autoloader and add your code.\n\n```php\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003efetch();\n\n$data = fb_feed()-\u003efetch(); // must have .env\n\n$config = [\n    'secret_key' =\u003e '',\n    'app_id' =\u003e '',\n    'page_name' =\u003e '',\n    'access_token' =\u003e '',\n];\n$data = fb_feed($config)-\u003efetch();\n$data = FbFeed::make($config)-\u003efetch();\n\n```\n\n\n#### Default (maximum post is 100)\n```php\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003efetch();\n```\n\n#### Set Module\n```php\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003esetModule(\"feeds\")\n        -\u003efetch();\n```\n\n#### Custom Maximum Post Shown\n```php\n// only show 5 post maximum\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003efeedLimit(5)\n        -\u003efetch();\n```\n\n#### Filter By Keyword\n```php\n// only show 5 post maximum\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003efindKeyword(\"#LaravelCommunity\")\n        -\u003efetch();\n```\n\n#### Change Request Field\n```php\n// only show 5 post maximum\n$data = fb_feed()-\u003esetAppId($fbAppId)\n        -\u003esetSecretKey($fbSecretKey)\n        -\u003esetPage($fbPageName)\n        -\u003efields(\"id,message\") //default 'id,message,created_time' \n        -\u003efields([\"id\",\"message\"]) // can be array\n        -\u003efetch();\n```\n\n#### To get owner's fb page feed using userAccessToken\n\nDetails to get `userAccessToken` can refer [here](https://github.com/xmhafiz/fb-page-feed/pull/7).\n\n```php\n$data = fb_feed()\n        -\u003esetAccessToken($userAccessToken)\n        -\u003esetPage($fbPageName)\n        -\u003efetch();\n```\n\n## Code Example\n\nChange the `$fbSecretKey` and `$fbAppId` based on the \"App ID\" and \"App Secret\" in Step 1\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php';\n\n$fbSecretKey='580c7...';\n$fbAppId='237...';\n$fbPageName='LaravelCommunity';\n\n$response = fb_feed()-\u003esetAppId($fbAppId)-\u003esetSecretKey($fbSecretKey)-\u003esetPage($fbPageName)-\u003efindKeyword(\"#tutorial\")-\u003efetch();\n\n//or\n\n$response = fb_feed()-\u003esetCredential($fbAppId, $fbSecretKey)-\u003esetPage($fbPageName)-\u003efindKeyword(\"#tutorial\")-\u003efetch();\n\nheader('Content-type: application/json');\necho json_encode($data);\n\n```\n\n#### Using ENV\n\n```\nFB_SECRET_KEY=absbo123o233213\nFB_APP_ID=123123123123\nFB_PAGENAME=pagename\n\n```\n\nThen, Just\n\n```\n$response = fb_feed()-\u003efindKeyword(\"#AirSelangor\")-\u003efetch();\n```\n\n\n### Method\n\u003ctable border=\"1\"\u003e\n    \u003ctr\u003e\n        \u003cth\u003eMethod\u003c/th\u003e\n        \u003cth\u003eParam\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetAppId\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFB Application ID (Default is in .env)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetSecretKey\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFB Application Secret ID (Default is in .env)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetCredential\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString, String\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eSet Both Secret and App Id (Default is in .env)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003efields\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eList of Attributes (Default : \u003ccode\u003eid,message,created_time,from,permalink_url,full_picture\u003c/code\u003e)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003esetPage\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eSet Page Name (Default is in .env)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003efindKeyword\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eString | Array\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFilter String by certain Keywords\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003efeedLimit\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eInteger\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eSet result count limit\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Result\n\nYou should getting data similarly like below:\n```json\n{\n    \"error\": false,\n    \"status_code\": 200,\n    \"data\": [\n        {\n            \"id\": \"365155643537871_1321961834523909\",\n            \"message\": \"The APPDATA or COMPOSER_HOME environment variable must be set for composer to run correctly\\\"\\nwhat bug?\",\n            \"created_time\": \"2017-05-14T15:45:30+0000\",\n            \"from\": {\n                \"name\": \"Phạm Nam\",\n                \"id\": \"424522607913714\"\n            },\n            \"permalink_url\": \"https://www.facebook.com/LaravelCommunity/posts/1321961834523909\"\n        },\n        {\n            \"id\": \"365155643537871_1766722286972894\",\n            \"message\": \"https://www.youtube.com/channel/UCQ6fynaWa81JqPzOBMmBTSw\\nLaravel BAsic To Advance LEarning Step by STep\",\n            \"created_time\": \"2017-05-13T07:18:53+0000\",\n            \"from\": {\n                \"name\": \"Wasiim Khan\",\n                \"id\": \"1766622610316195\"\n            },\n            \"permalink_url\": \"https://www.facebook.com/photo.php?fbid=1766722286972894\u0026set=o.365155643537871\u0026type=3\",\n            \"full_picture\": \"https://scontent.xx.fbcdn.net/v/t1.0-9/18403359_1766722286972894_2242179936023685636_n.jpg?oh=679c3e230ef55759ebe0e42239318e27\u0026oe=597B1F7D\"\n        },\n        {\n            \"id\": \"365155643537871_1320698884650204\",\n            \"message\": \"ai cho em hou noi nay bi sao vay.\\nIntegrity constraint violation: 1048 Column 'order' cannot be null\",\n            \"created_time\": \"2017-05-13T05:05:27+0000\",\n            \"from\": {\n                \"name\": \"Trong Phạm Sr.\",\n                \"id\": \"891899864284241\"\n            },\n            \"permalink_url\": \"https://www.facebook.com/LaravelCommunity/posts/1320698884650204\"\n        }\n    ]\n}\n```\n\n## Notes\nTo use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.\n\n## To use with **dotenv** \n- Look at [example code](https://github.com/xmhafiz/fb-page-feed/blob/master/example/index.php)\n- copy the `env.example` file to `.env` and make sure fill all the required environment variable (`FB_SECRET_KEY`, `FB_APP_ID`, `FB_PAGENAME`)\n\n## License\nLicensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmhafiz%2Ffb-page-feed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmhafiz%2Ffb-page-feed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmhafiz%2Ffb-page-feed/lists"}