{"id":13747592,"url":"https://github.com/johanbrook/github-facebook-hook","last_synced_at":"2025-08-12T02:14:04.911Z","repository":{"id":2760391,"uuid":"3758420","full_name":"johanbrook/github-facebook-hook","owner":"johanbrook","description":"Post a message on a Facebook group's wall when somebody does a push","archived":false,"fork":false,"pushed_at":"2014-07-02T12:20:53.000Z","size":164,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-11T07:22:57.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/johanbrook.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":"2012-03-18T22:07:42.000Z","updated_at":"2019-09-22T14:20:51.000Z","dependencies_parsed_at":"2022-09-08T05:51:12.885Z","dependency_job_id":null,"html_url":"https://github.com/johanbrook/github-facebook-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johanbrook/github-facebook-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2Fgithub-facebook-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2Fgithub-facebook-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2Fgithub-facebook-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2Fgithub-facebook-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johanbrook","download_url":"https://codeload.github.com/johanbrook/github-facebook-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johanbrook%2Fgithub-facebook-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269987123,"owners_count":24508176,"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-08-12T02:00:09.011Z","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":[],"created_at":"2024-08-03T06:01:34.535Z","updated_at":"2025-08-12T02:13:59.894Z","avatar_url":"https://github.com/johanbrook.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"![Post](http://f.cl.ly/items/1Z0G1R2c3c2y1T0h1c0P/Sk%C3%A4rmavbild%202012-03-19%20kl.%2013.08.14.png)\n\n## Why\n\nIn a project we have this private Facebook group for random links and notifications. Instead of sending annoying e-mails to every group member whenever somebody makes a `git push` to our GitHub repo, I created a simple service that posts post receive hook information to that Facebook group's wall instead.\n\n## How\n\nThe service is a simple Sinatra server which uses the [Koala gem](https://github.com/arsduo/koala) for Facebook's Graph API.\n\nDownload this web service and install dependencies (uses Bundler).\n\n\tgit clone git://github.com/johanbrook/github-facebook-hook.git\n\tcd github-facebook-hook\n\tbundle install\n\nYou need a Facebook app and an \"Access Token\" in order to post with the Graph API. Read more in the [Authentication info](http://developers.facebook.com/docs/authentication/#applogin) at Facebook. I recommend scanning through some [Facebook API reference](http://developers.facebook.com/docs/reference/api/) as well.\n\nA neat way of generating an Access Token is to visit Facebook's [Graph API Explorer](http://developers.facebook.com/tools/explorer) and generate from there. Note that the access token seem to have very short expiration time – I currently have to regenerate it every 2 hours or so. I'll investigate.\n\nWhen you have your token, add it to `keys-sample.rb` and rename that file to `keys.rb`.\n\n\tmodule Keys\n\t\tACCESS_TOKEN = \"\u003cyour token here\u003e\"\n\tend\n\nBe sure to change the require in `app.rb` to `require \"./keys\"` instead of `keys-sample`.\n\nCheck that everything works.\n\n\truby app.rb\n\topen http://localhost:4567\n\nYou should see a \"Nothing here\" text.\n\nNow create a free Heroku app to host the web service (if you have another server, skip this step).\n\n\theroku create \u003cappname\u003e --stack cedar\n\tgit remote add heroku git@heroku.com:\u003cappname\u003e.git\n\nAdd the access token as a Heroku environment variable.\n\n\theroku config:add FB_ACCESS_TOKEN=\u003cyour token\u003e\n\nWhen that's done, grab the URL to your Heroku app (something like `http://\u003cappname\u003e.herokuapp.com`).\n\nNext, go the the GitHub repo you want to **watch**, and choose \"Admin\" \u003e \"Webhooks \u0026 Services\" \u003e \"Add webhooks\". Add the URL to your Heroku app and append `/facebook`.\n\n\thttp://\u003cappname\u003e.herokuapp.com/facebook\n\nPress \"Update Settings\".\n\n**Done!**\n\nWhenever somebody **pushes** to the GitHub repo, your web service on Heroku will receive a POST request, and pass that along to a Facebook group's wall with the Graph API. Neat, eh?\n\n## Stuff I should do\n\n- Make the tool more general and ready almost out-of-the-box. Don't make it involve that many steps.\n- Support not only group walls, but user and friends' walls as well, perhaps with different routes.\n- Better handling of access token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanbrook%2Fgithub-facebook-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohanbrook%2Fgithub-facebook-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohanbrook%2Fgithub-facebook-hook/lists"}