sorenlouv / fb-sleep-stats

Use Facebook to track your friends’ sleeping habits
https://medium.com/@sqrendk/how-you-can-use-facebook-to-track-your-friends-sleeping-habits-505ace7fffb6
MIT License
1.62k stars 314 forks source link

Where are the sleep periods saved? #93

Open tensojka opened 8 years ago

tensojka commented 8 years ago

I mean not the times when people were online but times between which is night and are more than 5 hours apart from each other. (You can see at a user page in the table) Or is it generated on the fly? What code (file is enough, I can find it myself) does generate it then?

btw thank you guys a lot, I'm making a school project about sleep based on input from this!

sorenlouv commented 8 years ago

As you know the timestamps for when the users are online is stored here: ./src/server/services/db.json

The table overview of the users' sleep cycle is generated on the fly from these timestamp. You can find the code here: https://github.com/sqren/fb-sleep-stats/blob/master/src/browser/services/chart.js#L41