{"id":16902712,"url":"https://github.com/csabapalfi/facebook-scrape-group","last_synced_at":"2025-09-21T16:31:11.846Z","repository":{"id":34350756,"uuid":"139490516","full_name":"csabapalfi/facebook-scrape-group","owner":"csabapalfi","description":"🕸️ Scrape facebook group post permalinks","archived":false,"fork":false,"pushed_at":"2022-12-10T18:05:41.000Z","size":84,"stargazers_count":37,"open_issues_count":5,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T08:03:10.401Z","etag":null,"topics":["facebook","groups","scraper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/csabapalfi.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}},"created_at":"2018-07-02T20:23:08.000Z","updated_at":"2024-10-10T10:58:05.000Z","dependencies_parsed_at":"2023-01-15T06:31:03.879Z","dependency_job_id":null,"html_url":"https://github.com/csabapalfi/facebook-scrape-group","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csabapalfi%2Ffacebook-scrape-group","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csabapalfi%2Ffacebook-scrape-group/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csabapalfi%2Ffacebook-scrape-group/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csabapalfi%2Ffacebook-scrape-group/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csabapalfi","download_url":"https://codeload.github.com/csabapalfi/facebook-scrape-group/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233770235,"owners_count":18727550,"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","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","groups","scraper"],"created_at":"2024-10-13T18:07:34.256Z","updated_at":"2025-09-21T16:31:11.516Z","avatar_url":"https://github.com/csabapalfi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scrape facebook group post permalinks\n\n...with puppeteer and MutationObserver\n\nThis is a one (now three) night hack that I used to scrape 8K+ permalink ids from a secret facebook group we use to share photos with family. It became an annoyance that there was no way to search posts by date and manually scrolling back over 2-3 years is not an option.\n\n## UPDATE: this is much easier via the Graph API\n\nSee [api.js](api.js) that I'm yet to document here but pretty straightforward. You just need the numeric group id and an access token. (See also [Graph API Explorer here](https://developers.facebook.com/tools/explorer/?method=GET\u0026path=%7Bgroup-id%7D%2Ffeed\u0026version=v3.0))\n\nThe API also supports specifying date ranges as UNIX timestamps (e.g. `?since=1420070400\u0026until=1430070400`) so there's no need to paginate through the whole feed to get to dates years ago.\n\n## Requirements\n\n* MacOS\n* Google Chrome installed (and logged in to facebook)\n* `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn`\n\n\u003e [PUPPETEER_SKIP_CHROMIUM_DOWNLOAD](https://pptr.dev/#?product=Puppeteer\u0026version=v2.1.0\u0026show=api-environment-variables) to skip downloading Chromium since we'll use your default Chrome anyway\n\n## Usage\n\n### 1. Quit Google Chrome (if you have it running) \n\n* This is required to start a new Chrome instance with remote debugging enabled to allow Puppeteer to connect to it.\n* This Chrome instance will use your default profile that's assumed to be logged in to facebook.\n\n### 2. Start the script\n\n```sh\nnode index.js \u003cgroupid\u003e | tee permalinks.csv\n```\n\n* Output is simply CSV: `\u003cISO date\u003e, \u003cfacebook post URL\u003e` (one per line).\n* ...that post from 2014 is available to you again if you were patient enough.\n\n## How\n\nThis script:\n\n* starts up Chrome with your default profile (and remote debugging enabled)\n* connects to Chrome with Puppeteer\n* goes to your facebook group page\n* registers a MutationObserver and starts scrolling\n* for each node (post) added tries to grab the permalink id\n\n## Caveats\n\n* it's just a one (OK, now three) night hack, quality is like that :D\n* permalinks for posts on the first page are not captured","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsabapalfi%2Ffacebook-scrape-group","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsabapalfi%2Ffacebook-scrape-group","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsabapalfi%2Ffacebook-scrape-group/lists"}