• Stars
    star
    1,576
  • Rank 28,592 (Top 0.6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use Facebook to track your friends’ sleeping habits

fb-sleep-stats: Using Facebook to track your friends' sleep

A 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.

Read the blog post: https://medium.com/@sqrendk/how-you-can-use-facebook-to-track-your-friends-sleeping-habits-505ace7fffb6

Facebook Sleep Screenshot

Installation

Prerequisites

Clone repository

git clone https://github.com/sqren/fb-sleep-stats.git

Configuration

Open the source code folder:

cd fb-sleep-stats

Copy the default config file:

cp config/default.json config/development.json

Update the following values in config/development.json

Make sure there are no trailing tabs or spaces in the config file!

Install dependencies

npm install

Build browser dependencies

npm run webpack

Starting

You need to have two processes running simultaniously: the scraper and the webserver. Therefore, you must run the following two commands in separate windows/tabs.

Start scraping

This will run continously, polling Facebook every 10 minutes. Keep it running for as long as you want to track sleep.

npm run scrape

Start server

npm start

See the result in the browser: http://localhost:3000

#Troubleshooting

I get an error when running "npm run webpack"

Try re-installing the node-modules:

rm -rf node_modules
npm install
npm run webpack

No users show up

  • If you have an ad-blocker, you must disable it for the site.
  • You need to run npm run scrape and keep it running. When you stop it, it will stop tracking.

Changes to development.json are not picked up

  • You have to run npm run webpack

How do I update to the latest version?

After pulling the latest version, you must rebuild the dependencies:

git pull
rm -rf node_modules
npm install
npm run webpack

ReferenceError: Promise is not defined

Update 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:

rm -rf node_modules
npm install
npm run webpack

Cannot parse config file

Your config file contains invalid json. Find the errors by using a tool like http://jsonlint.com/

Where is the data stored?

You can find the data in JSON-format here: src/server/services/db.json.

Other issues

If you encounter a bug or have a problem, please go to Issues 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

Disclaimer

Facebook 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.

More Repositories

1

backport

A simple CLI tool that automates the process of backporting commits on a GitHub repo
TypeScript
237
star
2

alfred-currency

Workflow for Alfred to quickly lookup and convert currencies
PHP
80
star
3

await-sleep

Delay with async/await
JavaScript
39
star
4

github-widescreen

Chrome extension to toggle the width of Github
CSS
32
star
5

eslint-compare

A tool to visually compare differences between ESLint configurations
JavaScript
31
star
6

freedom

DEPRECATED. Freedom Calendar - FAAS (Filter As A Service) for Facebook Events
PHP
25
star
7

backport-github-action

Backport CLI tool as a Github Action
TypeScript
22
star
8

fb-sleep

Simple module to retrive a list of Facebook friends, and when they were last online
JavaScript
16
star
9

frametalk

Simple postMessage wrapper to make cross-frame communication easy as pie. Supports promises and return values. (No dependencies)
JavaScript
11
star
10

countdown.run

A modern countdown for the web. Offline support, "close-tab-resistant" and simple.
JavaScript
8
star
11

ocr-nemid

Store NemId digitally and easily find the codes you need
JavaScript
6
star
12

react-router-breadcrumb-example

Example of creating breadcrumbs in react-router 4
JavaScript
6
star
13

anybase-calculator

Calculator for any numeral system (binary, octal, decimal, hex etc.)
JavaScript
5
star
14

react-redux-request

Declarative data fetching for React, stored in Redux.
JavaScript
4
star
15

fave-scraping

Scraping of public interfaces without a proper API like Yelp and Google for Geocoding
JavaScript
3
star
16

huemon

Monitor Philips Hue lights with Elasticsearch and Kibana
TypeScript
3
star
17

cpr-calculator

Calculates all possible Danish social security numbers for a birthday
JavaScript
3
star
18

tsapi-electron

Postman-like app, but with configuration files...
CSS
2
star
19

backport-server

Automatically backport pull request
TypeScript
2
star
20

logs-onboarding-demo-app

Demo app for producing logs
JavaScript
2
star
21

eurovision-2014

JavaScript
2
star
22

synthbeans-node

A tool to generate predictable APM data making it easier to spot calculation errors in APM ui.
TypeScript
2
star
23

pr-push-action

Run a command on a PR that causes to update. The change is then committed.
TypeScript
2
star
24

huskbarnet.dk

JavaScript
2
star
25

tradeshift-mobile

Lets be honest - invoicing sucks and no sane person wants to do it. The only reason we still have invoices today is because no one bothered to break out of the restrictions introduced years ago by this legacy format called paper. And we're kinda past that now, so lets just move on and we can all forget about the craziness of invoices, credit notes, purchase orders, remittance advice and other concepts we really don't want to take up space in our heads. We will be building a mobile first application that automates all the legal requirements around invoicing (using tradeshifts public api), based on sensible, structured human-to-human communication.
CSS
2
star
26

github-action-playground

Testing out github action capabilities
JavaScript
1
star
27

medlems-klubben.dk

CSS
1
star
28

github-dashboard

JavaScript
1
star
29

2019-june-typescript-presentation

Presentation at Elastic about Typescript "stuff"
1
star
30

didibackport

JavaScript
1
star
31

projectidentity

CoffeeScript
1
star
32

eurovision-scrape-2014

JavaScript
1
star
33

fave-frontend

Java
1
star
34

lyft-surge-pricing

JavaScript
1
star
35

fb-leak

JavaScript
1
star