{"id":13453644,"url":"https://github.com/sorenlouv/fb-sleep-stats","last_synced_at":"2025-05-16T00:04:42.097Z","repository":{"id":50525444,"uuid":"48824160","full_name":"sorenlouv/fb-sleep-stats","owner":"sorenlouv","description":"Use Facebook to track your friends’ sleeping habits","archived":false,"fork":false,"pushed_at":"2020-09-29T11:33:35.000Z","size":80,"stargazers_count":1656,"open_issues_count":48,"forks_count":314,"subscribers_count":81,"default_branch":"master","last_synced_at":"2025-05-10T08:02:02.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://medium.com/@sqrendk/how-you-can-use-facebook-to-track-your-friends-sleeping-habits-505ace7fffb6","language":"JavaScript","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/sorenlouv.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}},"created_at":"2015-12-30T23:46:59.000Z","updated_at":"2025-05-09T20:17:49.000Z","dependencies_parsed_at":"2022-09-01T18:11:37.683Z","dependency_job_id":null,"html_url":"https://github.com/sorenlouv/fb-sleep-stats","commit_stats":null,"previous_names":["sorenlouv/fb-sleep-stats","sqren/fb-sleep-stats"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorenlouv%2Ffb-sleep-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorenlouv%2Ffb-sleep-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorenlouv%2Ffb-sleep-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorenlouv%2Ffb-sleep-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorenlouv","download_url":"https://codeload.github.com/sorenlouv/fb-sleep-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"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-07-31T08:00:44.949Z","updated_at":"2025-05-16T00:04:42.024Z","avatar_url":"https://github.com/sorenlouv.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Tools by Category"],"sub_categories":["👤 Username \u0026 Identity Research"],"readme":"# fb-sleep-stats: Using Facebook to track your friends' sleep\n\nA small tool to show the potential privacy implications modern social media have. By tracking online/offline status of people on Facebook, it is possible to get an accurate image of their sleep pattern.\n\nRead the blog post: https://medium.com/@sqrendk/how-you-can-use-facebook-to-track-your-friends-sleeping-habits-505ace7fffb6\n\n![Facebook Sleep Screenshot](https://cloud.githubusercontent.com/assets/209966/13382859/b7b31aa4-de7e-11e5-8fca-35d68fe2f02f.png)\n\n\n## Installation\n\n**Prerequisites**\n - Git ([how to install](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git))\n - Node.js ([how to install](https://docs.npmjs.com/getting-started/installing-node))\n\n**Clone repository**\n```\ngit clone https://github.com/sqren/fb-sleep-stats.git\n```\n\n**Configuration**\n\nOpen the source code folder:\n```\ncd fb-sleep-stats\n```\n\nCopy the default config file:\n```\ncp config/default.json config/development.json\n```\n\nUpdate the following values in `config/development.json`\n - \"c_user\": [your numeric Facebook user id](http://findmyfbid.com/)\n -  \"xs\": [xs value from Facebook cookie](https://gist.github.com/sqren/0e4563f258c9e85e4ae1)\n - \"appId\": [Facebook App Id](https://gist.github.com/sqren/1ac0f5d316fcbd46d8c1)\n\n*Make sure there are no trailing tabs or spaces in the config file!*\n\n**Install dependencies**\n```\nnpm install\n```\n\n**Build browser dependencies**\n```\nnpm run webpack\n```\n\n## Starting\n\nYou need to have two processes running simultaniously: the scraper and the webserver. Therefore, you must run the following two commands in separate windows/tabs.\n\n**Start scraping**\n\n*This will run continously, polling Facebook every 10 minutes. Keep it running for as long as you want to track sleep.*\n```\nnpm run scrape\n```\n\n**Start server**\n```\nnpm start\n```\n\nSee the result in the browser: [http://localhost:3000](http://localhost:3000)\n\n#Troubleshooting\n\n**I get an error when running \"npm run webpack\"**\n\nTry re-installing the node-modules:\n```\nrm -rf node_modules\nnpm install\nnpm run webpack\n```\n\n**No users show up**\n - If you have an ad-blocker, you must disable it for the site.\n - You need to run `npm run scrape` and keep it running. When you stop it, it will stop tracking.\n\n**Changes to development.json are not picked up**\n - You have to run `npm run webpack`\n\n**How do I update to the latest version?**\n\nAfter pulling the latest version, you must rebuild the dependencies:\n```\ngit pull\nrm -rf node_modules\nnpm install\nnpm run webpack\n```\n\n**ReferenceError: Promise is not defined**\n\nUpdate Node.js to the latest stable version of the branch you are on (v5.7.1, v4.3.2 or v0.12.11). After that rebuild dependencies:\n```\nrm -rf node_modules\nnpm install\nnpm run webpack\n```\n\n**Cannot parse config file**\n\nYour config file contains invalid json. Find the errors by using a tool like [http://jsonlint.com/](http://jsonlint.com/)\n\n**Where is the data stored?**\n\nYou can find the data in JSON-format here: `src/server/services/db.json`.\n\n**Other issues**\n\nIf you encounter a bug or have a problem, please go to [Issues](https://github.com/sqren/fb-sleep-stats/issues?utf8=%E2%9C%93\u0026q=is%3Aissue+) and use the search functionality, in case someone else already asked the question. If you can't find anything helpful you are very welcome to create a [new issue](https://github.com/sqren/fb-sleep-stats/issues/new)\n\n\n# Disclaimer\nFacebook reached out to me and informed me, that it is against their terms to access their website by automated means. Additionally I am not allowed to urge anyone to do so. Therefore: I urge you to use this project for educational purpose only, and not use it to access Facebook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorenlouv%2Ffb-sleep-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorenlouv%2Ffb-sleep-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorenlouv%2Ffb-sleep-stats/lists"}