{"id":18952188,"url":"https://github.com/Lastaapps/fb-pages-discord-bot","last_synced_at":"2025-09-05T13:32:39.576Z","repository":{"id":255580983,"uuid":"817350149","full_name":"Lastaapps/fb-pages-discrod-bot","owner":"Lastaapps","description":"Scrapes Facebook pages post and sends them to a discord channel","archived":false,"fork":false,"pushed_at":"2024-09-05T12:12:02.000Z","size":372,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T13:38:16.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lastaapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-06-19T14:16:06.000Z","updated_at":"2024-09-05T12:12:05.000Z","dependencies_parsed_at":"2024-09-06T05:52:50.938Z","dependency_job_id":null,"html_url":"https://github.com/Lastaapps/fb-pages-discrod-bot","commit_stats":null,"previous_names":["lastaapps/fb-pages-discrod-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lastaapps%2Ffb-pages-discrod-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lastaapps%2Ffb-pages-discrod-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lastaapps%2Ffb-pages-discrod-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lastaapps%2Ffb-pages-discrod-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lastaapps","download_url":"https://codeload.github.com/Lastaapps/fb-pages-discrod-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232043970,"owners_count":18464544,"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":[],"created_at":"2024-11-08T13:31:27.608Z","updated_at":"2025-09-05T13:32:29.564Z","avatar_url":"https://github.com/Lastaapps.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FB Pages Discord Bot\n\nThe bot gets posts from the Facebook pages given and reposts them to\nspecified Discord channels. It comes in two variants:\nFacebook Graph API where you need the page admins to log in to the app\nand scraping, that needs a bot account that will probably get banned quite quickly.\nNo one said it's going to be easy.\n\nTranslations from Czech are missing in both variants, feel free to create a PR.\n\n## Facebook Graph API\n\nThis is the preferred mode, but it's significantly more complicated to set up.\nAfter you set up the server, an expected login link will be printed to the console.\nYou send the link to page admins, they get redirected to a Facebook authorization\npage where they give your app a basic permission.\nThen you create a Discord bot and add it to your server.\nThe app has no frontend for assigning pages to channels,\nall this is done using the API described bellow.\n\n### Facebook APP\n\nYou log into Facebook developer account and create a business app.\nYou enable Facebook Business Login (if it is not presented, you created a wrong app type),\nadd redirect URL and create a configuration with `pages_show_list` permission.\nFacebook login required you to use https instead of http (you should do it anyway).\nTo grant access to a page, you either need a Facebook business portfolio verified as a Tech Provider,\nor you need one of the page admins to become tester of your app. Facebook developer account\nis required to become a tester.\n\n### Setup\n\nOnce you have a Discord bot and FB app created, build a Docker image\nfrom this repository and run it with environment variables according\nto `.env_example`. All the fields from this category are required as I'm lazy to set defaults.\n\n### Management\n\nThe management is handled using three simple endpoints.\nYou can also edit the database directly as the schema is really simple.\nAll the `/admin` endpoints are secured by the access token set in your environment variables.\nPass it as a URL param `access_token=YOUR_TOKEN`.\n\n- `POST /admin/:channel_id/:page_id` - Link the page to the channel\n- `DELETE /admin/:channel_id/:page_id` - Unlink the page to the channel\n- `GET /admin/status` - Lists authorized pages and channels they are linked to.\n\nI recommend using cURL or Postman for this.\n\n### Docker Compose\n\nWe provide example Docker Compose file bellow:\n\n```docker-compose\nservices:\n  bot:\n    build: https://github.com/Lastaapps/fb-pages-discrod-bot.git#main\n    restart: always\n    env_file:\n      - env\n    ports:\n      - 127.0.0.1:8080:8080\n    volumes:\n      - ./storage:/storage:rw\n```\n\n```env\nFB_DC_API_SERVER_HOST=localhost\nFB_DC_API_SERVER_PORT=8080\nFB_DC_API_DATABASE_FILENAME=/storage/database.db\n...\n```\n\n#### Disclaimer\n\nThe code for this part is quite a spaghetti one, I'm aware of it, and I'm not\nchanging it as I don't have time nor will for it and this is good enough anyway.\n\n## Scraping\n\nIn this mode the app scrapes data from the `mbasic.facebook.com` Facebook frontend.\nThis mode is no longer supported nor maintained, but it may still work.\n\n### Deployment\n\nFirst you need to create a bot account and\nset up the account's translation options\nhttps://m.facebook.com/settings/language/auto_translate_disabled_dialects/\n\nAfter that, create a Discord bot, get the token and add the bot to the desired server.\n\nThen set up your environment variables according to `.evn_example`.\nLog into your account, take the cookie you got, take the desired fields (url decode them).\nAfter that specify bot's Discord token, channel ID to post the posts into,\ndelay how ofter a full scan will happen and weight of your mum.\n*Don't use your main account as it may get banned.*\n\n#### Race Conditions\n\nIt may happen that if a post is at the time of server startup\npublished n hours ago,\nsome other posts may be skipped from being posted/posted twice.\nTo minimize the chance of this happening, start the bot during weekend.\n\n## Development\n\nI recommend EnvFile plugin for developing this project.\n\n## License\n\nThe app is licensed under the `GNU GPL v3.0` license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLastaapps%2Ffb-pages-discord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLastaapps%2Ffb-pages-discord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLastaapps%2Ffb-pages-discord-bot/lists"}