{"id":20463516,"url":"https://github.com/kerigansolutions/facebookfeed","last_synced_at":"2026-02-14T12:02:51.744Z","repository":{"id":57005719,"uuid":"110025512","full_name":"kerigansolutions/facebookfeed","owner":"kerigansolutions","description":"Easily pull posts and events into your WordPress Site from a Facebook page that you manage.","archived":false,"fork":false,"pushed_at":"2018-02-23T22:55:00.000Z","size":31,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T19:42:20.677Z","etag":null,"topics":["composer-library","facebook-api","facebook-graph-api","php","php7","wordpress","wordpress-development"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kerigansolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T20:14:30.000Z","updated_at":"2021-07-29T12:59:42.000Z","dependencies_parsed_at":"2022-08-21T12:40:37.224Z","dependency_job_id":null,"html_url":"https://github.com/kerigansolutions/facebookfeed","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/kerigansolutions/facebookfeed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerigansolutions%2Ffacebookfeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerigansolutions%2Ffacebookfeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerigansolutions%2Ffacebookfeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerigansolutions%2Ffacebookfeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerigansolutions","download_url":"https://codeload.github.com/kerigansolutions/facebookfeed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerigansolutions%2Ffacebookfeed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276994745,"owners_count":25741875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["composer-library","facebook-api","facebook-graph-api","php","php7","wordpress","wordpress-development"],"created_at":"2024-11-15T13:11:44.358Z","updated_at":"2025-09-25T23:21:40.463Z","avatar_url":"https://github.com/kerigansolutions.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KMA WordPress Facebook Feed\nEasily pull posts and events into your WordPress Site from a Facebook page that you manage.\n## Installation\n`composer require kerigansolutions/facebookfeed`\n## Setup\n### Get your Facebook Page ID and Access token\n- Facebook Page ID\n    + Open your Facebook Page\n    + Click \"About\"\n    + Scroll down to the \"More Info\" section\n    + Under Page ID, you will find your page ID\n- App Access Token\n    + Create a new app in the [Facebook Developer Console](https://developers.facebook.com/apps/)\n    + Use the [Access Token tool](https://developers.facebook.com/tools/accesstoken/) to retrieve your App Access Token\n\n- Add your Facebook Page ID and Access Token to `wp-config.php`\n```\ndefine('FACEBOOK_PAGE_ID', 'YOUR FACEBOOK PAGE ID HERE');\ndefine('FACEBOOK_ACCESS_TOKEN', 'YOUR FACEBOOK TOKEN HERE');\n```\n## Quick Start\n```php\n\n$facebookFeed  = new KeriganSolutions\\FacebookFeed\\FacebookFeed();\n$numberOfPosts = 5;\n\n$results = $facebookFeed-\u003efetch($numberOfPosts);\n\necho '\u003cpre\u003e',print_r($results),'\u003c/pre\u003e';\n\n```\n## Pagination\nThis package uses the default cursor-based pagination that is returned by the Facebook Graph API. Let's take a look at how to implement this in our WordPress site:\n### Make the API call and retrieve the results:\n```php\n$facebookFeed  = new KeriganSolutions\\FacebookFeed\\FacebookFeed();\n$numberOfPosts = 5;\n\n$results = $facebookFeed-\u003efetch($numberOfPosts);\n```\nWe've covered this already. So far, so good. Let's look at the returned data:\n```\nstdClass Object\n(\n    [posts] =\u003e Array\n        (\n            [0] =\u003e stdClass Object\n                (\n                    [permalink_url] =\u003e https://www.facebook.com/XXXXXXXX/posts/1989865411030718\n                    [full_picture] =\u003e https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/24958917_1989865411030718_66...\n                    [object_id] =\u003e 1989865411030718\n                    [type] =\u003e photo\n                    [status_type] =\u003e added_photos\n                    [created_time] =\u003e 2017-12-10T22:51:24+0000\n                    [link] =\u003e https://www.facebook.com/XXXXXX/photos/a.1989861894364403.1...\n                    [attachments] =\u003e stdClass Object\n                        (\n                            [data] =\u003e Array\n                                (\n                                    [0] =\u003e stdClass Object\n                                        (\n                                            [target] =\u003e stdClass Object\n                                                (\n                                                    [url] =\u003e https://www.facebook.com/media/set/?set=ms.c.eJxNV1...\n                                                )\n\n                                            [media] =\u003e stdClass Object\n                                                (\n                                                    [image] =\u003e stdClass Object\n                                                        (\n                                                            [height] =\u003e 478\n                                                            [src] =\u003e https://scontent.xx.fbcdn.net/v/t31.0-8/s720x72..\n                                                            [width] =\u003e 720\n                                                        )\n\n                                                )\n\n                                        )\n\n                                )\n\n                        )\n\n                    [id] =\u003e 167644949919449_1989865411030718\n                )\n\n        )\n\n    [paging] =\u003e stdClass Object\n        (\n            [cursors] =\u003e stdClass Object\n                (\n                    [before] =\u003e Q2c4U1pXNTBYM0YxWlhKNVgzTjBiM0o1WDJ....\n                    [after] =\u003e Q2c4U1pXNTBYM0YxWlhKNVgzTjBiM0o1WDJs...\n                )\n\n            [next] =\u003e https://graph.facebook.com/v2.11/167644949919449/posts?access_token=3119470492897...\n        )\n\n)\n```\n\nFrom the [Facebook Graph API docs](https://developers.facebook.com/docs/graph-api/using-graph-api):\n\u003e    `before` : This is the cursor that points to the start of the page of data that has been returned. \n\u003e\n\u003e    `after` : This is the cursor that points to the end of the page of data that has been returned.\n\u003e\n\u003e    `next` : The Graph API endpoint that will return the next page of data. If not included, this is the last page of data. Due to how pagination works with visibility and privacy, it is possible that a page may be empty but contain a 'next' paging link. Stop paging when the 'next' link no longer appears.\n\u003e\n\u003e    `previous` : The Graph API endpoint that will return the previous page of data. If not included, this is the first page of data.\n\n### What does this mean?\nNow we know where the data starts and stops so we can get our next five results by passing some new arguments to the `fetch` function. Observe:\n```php\n$facebookFeed  = new KeriganSolutions\\FacebookFeed\\FacebookFeed();\n$numberOfPosts = 5;\n$before        = null;\n$after         = 'Q2c4U1pXNTBYM0YxWlhKNVgzTjBiM0o1WDJs...';\n\n$results = $facebookFeed-\u003efetch($numberOfPosts, $before, $after);\n\necho '\u003cpre\u003e',print_r($results),'\u003c/pre\u003e';\n\n```\n*NOTE: Cursors can change frequently and without warning from Facebook. DO NOT STORE cursors. Grab them dynamically and pass them to the next page using GET variables or another similar method*\n\n## Embedded videos\nIn order to handle embedding videos from your Facebook statuses on to your WordPress page, you'll need to conditionally check if the `post-\u003etype` is `video`, set up a standard iframe and pass the returned `link` value for the post into the `src` attribute. The package currently handles embedded Facebook, Vimeo, and Youtube videos. \n\n## Events\nEvents are handled similarly to posts.\n```php\n$fb     = new KeriganSolutions\\FacebookFeed\\FacebookEvents();\n$before = null;\n$after  = null;\n$events = $fb-\u003efetch(10, $before, $after);\n\necho '\u003cpre\u003e',print_r($events),'\u003c/pre\u003e';\n```\n\nDocs are a work in progress and a more in-depth guide will be coming soon.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerigansolutions%2Ffacebookfeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerigansolutions%2Ffacebookfeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerigansolutions%2Ffacebookfeed/lists"}