GithubHelp home page GithubHelp logo

sorenlouv / fb-sleep-stats Goto Github PK

View Code? Open in Web Editor NEW
1.6K 83.0 311.0 80 KB

Use Facebook to track your friends’ sleeping habits

Home Page: https://medium.com/@sqrendk/how-you-can-use-facebook-to-track-your-friends-sleeping-habits-505ace7fffb6

License: MIT License

JavaScript 91.50% HTML 0.91% CSS 7.59%

fb-sleep-stats's Introduction

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.

fb-sleep-stats's People

Contributors

anubisss avatar canvural avatar cydrobolt avatar daveystruijk avatar paulloz avatar sorenlouv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fb-sleep-stats's Issues

Error at "npm run build-minified"

It throws the error below :

[email protected] build-minified /home/noname/Desktop/fb-sleep-stats
webpack --progress --optimize-minimize

Hash: e2a1fab2f1d993dfabc2
Version: webpack 1.12.13
Time: 53ms

  • 1 hidden modules

ERROR in Cannot find module 'core-js/library/fn/get-iterator'

Error when using "npm run build-minified"

Hey guys,im getting the following error, thanks for replying in advance any help welcome

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-minified"
npm ERR! node v5.6.0
npm ERR! npm v3.7.3

npm ERR! missing script: build-minified
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Theden/npm-debug.log
MacBook-Pro:~ Theden$

From the debug file:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build-minified' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /Users/Theden/.npmrc. (matches userconfig)
5 verbose stack Error: missing script: build-minified
5 verbose stack     at run (/usr/local/lib/node_modules/npm/lib/run-script.js:147:19)
5 verbose stack     at /usr/local/lib/node_modules/npm/lib/run-script.js:57:5
5 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:345:5
5 verbose stack     at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:309:45)
5 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:343:3)
5 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:113:5)
5 verbose stack     at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:284:20)
5 verbose stack     at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
5 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13)
6 verbose cwd /Users/Theden
7 error Darwin 15.3.0
8 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-minified"
9 error node v5.6.0
10 error npm  v3.7.3
11 error missing script: build-minified
12 error If you need help, you may report this error at:
12 error     <https://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]

npm run scrape giving error "0 active users"

PS C:\Windows\system32> cd C:\dev\fb-sleep-stats-master
PS C:\dev\fb-sleep-stats-master> npm run scrape

[email protected] scrape C:\dev\fb-sleep-stats-master
node ./scrape.js
2/23/2016, 6:24:28 PM - 0 active users

There definitely are active users on my fb right now so not sure why that message shows.

Change

How change xs, appid and c_user?

Server Error

After pulling the recent changes i'm getting this error when try to access to server

Could not get list [TypeError: _(...).map(...).orderBy is not a function]

No stack trace or anything, so i don't where the error is.

can't access localhost:3000

I've setup according to the step-by-step procedure, and turn out when accessing localhost:3000 returning "This webpage is not available
ERR_CONNECTION_REFUSED"

I've checked /src/server/services/db.json does exist the json information.

Do I miss something to install?

White Page when viewing scraping results

I've been scraping for about 30 minutes, and the result page when running npm start is completely white. I'm not sure what I'm doing wrong, everything else seems to work fine.

Here is a screenshot:
screenshot_20160222_144309

For those looking to start this...

Couple of extra steps.

  1. You need to create a new Facebook app with http://localhost:3000 added to the domains.
  2. Change the appId inside src/browser/services/facebook.js to the newly created appId
  3. To start the server, run npm run build-minified before starting the server. You can also run forever-scrape and forever-server for a more permanent solution.

Pull too often - throttling issue?

I can't confirm for sure, but I set the time to 60 after installing to get data faster to play around with. After some time I was getting some error:

Polling every 60 seconds
2016-03-01 04:56:15  - Active users:  45 / 1902
2016-03-01 04:57:11  - Active users:  45 / 1902
2016-03-01 04:58:07  - Active users:  45 / 1902
2016-03-01 04:59:07  - Active users:  45 / 1902
2016-03-01 05:00:05  - Active users:  45 / 1902
2016-03-01 05:01:06  - Active users:  45 / 1902
2016-03-01 05:02:02  - Active users:  45 / 1902
2016-03-01 05:03:00  - Active users:  45 / 1902
2016-03-01 05:03:59  - Active users:  45 / 1902
2016-03-01 05:05:00  - Active users:  45 / 1902
An error occured in buddyList [Error: No users found]
2016-03-01 05:06:00  - Active users:  4 / 85
An error occured in buddyList [Error: No users found]
2016-03-01 05:07:01  - Active users:  4 / 85
An error occured in buddyList [TypeError: Cannot read property '0' of undefined]
2016-03-01 05:08:50  - Active users:  4 / 85
An error occured in buddyList [Error: No users found]
2016-03-01 05:09:46  - Active users:  4 / 85

I stopped the pooling and then restarted it with default 600 seconds and it hasn't run into an error yet. It barely passed the 10 minute mark though:D.

Can anyone confirm Facebook throttling this in some way? Or is this buddyList some other error (didn't look through the code yet, my apologies :D).

And Kudos to Søren!

Elaborate on a few steps please

Hi Søren, thank you for releasing this. It's a great way of showing how public our data is in contrary to talking or discussing it.

I would like to ask you (or somebody else) if you could elaborate on the steps "Install dependencies", "Build browser dependencies" and "Starting" section. I don't know what to do at these steps. I am using Mac OS X and not experienced with programming in this way although I am super excited to see my friends sleeping patterns and confronting them with it!

I hope to be able to run this soon too.

Kind regards,

Nikki

Unexpected error when scraping

Beginner here, when i run npm run scrape this error appears:

[email protected] scrape C:\Users\omonoiadam\Desktop\fb-sleep
node ./scrape.js
C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:886
throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
^
Error: Cannot parse config file: 'C:\Users\omonoiadam\Desktop\fb-sleep\config\development.json': SyntaxError: Unexpected token '
at util.parseFile (C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:886:11)
at C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:685:28
at Array.forEach (native)
at C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:681:14
at Array.forEach (native)
at util.loadFileConfigs (C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:680:13)
at new Config (C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:119:27)
at Object. (C:\Users\omonoiadam\Desktop\fb-sleep\node_modules\config\lib\config.js:1688:31)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

What did i do wrong? Here's my config:

{ 
'fbCookie': { 'c_user':"1000something61",
 "xs": "<redacted>
"}, "server": {
        "port": 3000
    }
}

ERROR in Cannot find module 'lodash/lang/isFunction'

Any idea how to fix this? It seems like lodash has the isFunction function in lodash/* and not lodash/lang/* as of 4.0.

PS C:\Users\Colaflaske\fb-sleep-stats> npm install
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN [email protected] requires a peer of continuation-local-storage@~3 but none was installed.
PS C:\Users\Colaflaske\fb-sleep-stats> npm run webpack

[email protected] webpack C:\Users\Colaflaske\fb-sleep-stats
webpack --progress

Hash: e2a1fab2f1d993dfabc2
Version: webpack 1.12.14
Time: 36ms
+ 1 hidden modules

ERROR in Cannot find module 'lodash/lang/isFunction'

NPM install error

npm WARN deprecated [email protected]: graceful-fs version 3 and before will fai l on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possibl e.

[email protected] postinstall C:\Users\tso\Desktop\fb-sleep-stats\node_modules\his tory
node ./npm-scripts/postinstall.js

[email protected] postinstall C:\Users\tso\Desktop\fb-sleep-stats\node_module s\react-router
node ./npm-scripts/postinstall.js

[email protected] C:\Users\tso\Desktop\fb-sleep-stats
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | | |-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | -- [email protected] | |-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | -- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| | -- [email protected] |-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| | -- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | | | +-- [email protected] | | | | +-- [email protected] | | | |-- [email protected]
| | | | -- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | | |-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | | -- [email protected] | | | |-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] | | +-- [email protected] | | |-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] |-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | -- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| -- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- UNMET PEER DEPENDENCY continuation-local-storage@~3
| -- [email protected] +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | | +-- [email protected] | | | | +-- [email protected] | | | | +-- [email protected] | | | | |-- [email protected]
| | | | +-- [email protected]
| | | | -- [email protected] | | |-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | -- [email protected] | | |-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | -- [email protected] |-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | | +-- [email protected] | | |-- [email protected]
| | -- [email protected] |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| | -- [email protected] | +-- [email protected] |-- [email protected]
+-- [email protected]
| -- [email protected] +-- [email protected] +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | -- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | -- [email protected] |-- [email protected]
-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| -- [email protected] | +-- [email protected] |-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| -- [email protected] |-- [email protected]
+-- [email protected]
| +-- [email protected]
| -- [email protected] +-- [email protected] |-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| -- [email protected] | +-- [email protected] | +-- [email protected] | | +-- [email protected] | | | +-- [email protected] | | | | +-- [email protected] | | | |-- [email protected]
| | | -- [email protected] | | +-- [email protected] | |-- [email protected]
| -- [email protected] +-- [email protected] | +-- [email protected] |-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | -- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | | | +-- [email protected] | | | | +-- [email protected] | | | |-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | +-- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | -- [email protected] | | |-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | -- [email protected] | |-- [email protected]
| | +-- [email protected]
| | -- [email protected] | +-- [email protected] | +-- [email protected] | +-- [email protected] | |-- [email protected]
| +-- [email protected]
| | -- [email protected] |-- [email protected]
| -- [email protected] -- [email protected]
`-- [email protected]

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fseve [email protected]
npm WARN [email protected] requires a peer of continuation-local-storage@~3 but none was installed.

I dont know what to do

is time zone considered?

I have some friends who are on the other side of the world. I see that the app considers that no activity after 8 pm is "sleep". however for some of my friends on other side of the world, is it local 8 PM or 8 PM at my time zone?

npm run build-minified error

Getting the following error when using npm run build-minified:

ERROR in ./src/browser/components/main.jsx
Module parse failed: /Applications/MAMP/htdocs/node_modules/fb-sleep-stats/src/browser/components/main.jsx Line 34: Unexpected token <
You may need an appropriate loader to handle this file type.
| render() {
| var isAuthenticated = this.state.isAuthenticated;
| var loginButton =


| return (
|

@ ./src/browser/main.js 1:0-32

any idea?

Can't access the data from anywhere but localhost

I understand this is as intended, but how can it be changed? For instance, I want to run this on my Raspberry Pi but when I do and load the page on my laptop, I click on the "log in to facebook" button and I'm met with

Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

I have no experience with Facebook apps and I've been at this for a while with no success. It was easy to get up and running on my desktop, but this tiny problem is really making it difficult on the Pi and I'd rather not leave my computer on for days at a time if possible.

how to change the value of config

sorry but im new to using Terminal on mac
after cp config/default.json config/development.json

how do i change the values in the config?

Stuck at run scrape

So i hit npm run scrape, and it is stuck at this

[email protected] scrape C:\Users\sdvfsdvc\Desktop\fb-sleep
node ./scrape.js
2/22/2016, 8:54:54 PM - 3 active users
what can i do?

Promise is not defined

Error occurred on AWS EC2 server running Ubuntu 14.04. Works fine on my local Windows machine with the same development.json file.

node ./scrape.js

Polling every 600 seconds
Sat Feb 27 2016 17:55:21 GMT+0000 (UTC) - Active users: 44 / 259
Sat Feb 27 2016 17:55:21 GMT+0000 (UTC) An error occured while scraping. Please check to make sure your development.json config is correct [ReferenceError: Promise is not defined]

Could not get users: Error: unable to get local issuer certificate undefined

I am getting the error

Could not get users: Error: unable to get local issuer certificate undefined

Everything else is set up and working. The server is running, and I have my proper ID stuff as well. Googling this came up with this stackoverflow question, however I am not quite sure what it is trying to tell me. If anyone knows what this means, that would be nice.

Error Cloning: Permission denied (publicly)

Thanks for this project!
I used the commend: git clone [email protected]:sqren/fb-sleep-stats.git
and get this error (Mac OSX Terminal app)

**Cloning into 'fb-sleep-stats'...
Permission denied (publicly).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
**

Blank after login in, no users

Everything is setup correctly but after i login to allow sleep stats to access data, nothing is shown, no users, just blank page with a search bar?
I am using Node 5 on Linux.

ERROR in Entry module not found: Error: Cannot resolve module 'babel' in /folderwithfb-sleep


npm run build-minified


> [email protected] build-minified /folderwithfb-sleep
> webpack --progress --optimize-minimize
                                                                                                                                                                                                             Hash: ~
Version: webpack 1.12.13
Time: 57ms

ERROR in Entry module not found: Error: Cannot resolve module 'babel' in /folderwithfb-sleep

npm is version 2.14.12
node is version v4.3.1, also tried with v4.0.0 and v5.6.0

This is on Ubuntu 14.04

Also when doing:

git clone [email protected]:sqren/fb-sleep-stats.git

I get:

Cloning into 'fb-sleep-stats'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

So I just did a git clone https://github.com/sqren/fb-sleep-stats

The scraper only gets some friends

The scraper only gets a subset of my friends. I saw some people were active few mins ago while the scraper did not take the timestamps and their name and put it in the db. Anyone else seem to be having the same issue?

npm install error

Hi guys, this is my npm-debug.log ,
i have a problem with it. Thanks for help.

0 info it worked if it ends with ok

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',

1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'run',

1 verbose cli   'scrape' ]

2 info using [email protected]

3 info using [email protected]

4 verbose config Skipping project config: C:\Users\Jablíčkář/.npmrc. (matches userconfig)

5 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\Jablíčkář\package.json'

5 verbose stack     at Error (native)

6 verbose cwd C:\Users\Jablíčkář

7 error Windows_NT 10.0.10586

8 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 

Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "scrape"

9 error node v4.3.1

10 error npm  v2.14.12

11 error path C:\Users\Jablíčkář\package.json

12 error code ENOENT

13 error errno -4058

14 error syscall open

15 error enoent ENOENT: no such file or directory, open 'C:\Users\Jablíčkář\package.json'

15 error enoent This is most likely not a problem with npm itself

15 error enoent and is related to npm not being able to find a file.

16 verbose exit [ -4058, true ]

Can't remove on windows

There is no easy way to remove this on windows. So many folders with such long names, makes them unable for windows to read them, so once installed, you have to rename or move every folder to be able to delete.

npm run build-minified error

"npm run build-minified" gives the error:

ERROR in .//css-loader!.//less-loader!./src/browser/components/main.less
Module build failed: ReferenceError: Promise is not defined
at LazyResult.async (.../fb-sleep-stats/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:157:31)
at LazyResult.then (.../fb-sleep-stats/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:79:21)
at processCss (.../fb-sleep-stats/node_modules/css-loader/lib/processCss.js:198:5)
at Object.module.exports (.../fb-sleep-stats/node_modules/css-loader/lib/loader.js:24:2)
@ ./src/browser/components/main.less 4:14-127

not possible to run mpn install

I'm going step by step but I can't run npm install. Is there something I'm missing??
2016-02-29 18_44_56-c__windows_system32_cmd exe

I've installed nodejs from official site.

Updating values

Hi, I have some problems updating the values because it´s the first thime i use Git

Could you type the code whit blank spaces to paste my information?

Thanks

"npm run webpack" error

I get an error when running "npm run webpack"

I tried rm -rf node_modules npm install npm run webpack

But

rm -rf node_modules
rm is not recognized as an internal or external command,
operable program or batch file.

Only runs for a short period of time showing a few friends

Everything seems to work properly with no errors, but when running the app it stops showing results after about 15-20 minutes. It also only shows a select few of my friends. In addition, nothing appears under period or duration.

I have been running it for around 3 hours now, and still the only entries are from the first 15 minutes or so.

"Given URL is not allowed by the Application configuration" on non-localhost server

The server works fine on my local machine with my own AppId, but when I tried running it on a cloud instance, Facebook's OAuth window gave me this error: Given URL is not allowed by the Application configuration. Has anyone gotten it to work on a remote ip / domain?

Because my server only has an IP address, I also tried setting one in my /etc/hosts file and configuring my facebook app to use that domain, but I still get the same error.

Scrape failing? Could not get users: Promise is not defined undefined

Hey, haven't been able to debug this properly. On running npm run scrape, it clearly gets as far as pulling the active users (and users object has their IDs)... but then I see this Promises-related error:

Could not get users: Promise is not defined undefined

Here's it is with a few lines for context...

> node ./scrape.js

Tue Feb 23 2016 07:45:17 GMT-0500 (EST)  -  1 active users
A error occured while scraping. Please check to make sure your development.json config is correct
Tue Feb 23 2016 07:45:17 GMT-0500 (EST)  - Could not get users: Promise is not defined undefined

Not sure if it's working or failing before the pulled data gets persisted anywhere.

The stats/dashboard sidebar doesn't present any user records.

Thoughts?

How is the time considered?

When it uptades (every 10 minutes), does it only see if the user is "active or not" or it also sees how long the user has been away (x minutes ago for ex)?

Thanks

App not set up

I am getting he following error:

App Not Setup: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.

If you get this error when you run "npm run build-minified" (SyntaxError Unexpected Token %...)

If you get something like this when you run
npm run build-minified

 webpack --progress --optimize-minimize

module.js:433
    throw err;
    ^

SyntaxError: /home/terje/Documents/Programming/fb-sleep-stats/config/development.json: Unexpected token %
    at Object.parse (native)
    at Object.Module._extensions..json (module.js:430:27)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/terje/Documents/Programming/fb-sleep-stats/webpack.config.js:3:14)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)

npm ERR! Linux 3.16.0-57-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-minified"
npm ERR! node v5.6.0
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build-minified: `webpack --progress --optimize-minimize`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build-minified script 'webpack --progress --optimize-minimize'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fb-sleep-stats package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --progress --optimize-minimize
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fb-sleep-stats
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fb-sleep-stats
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/terje/Documents/Programming/fb-sleep-stats/npm-debug.log
terje@W350STQUbuntu:~/Documents/Programming/fb-sleep-stats$ nano confg/development.json
Use "fg" to return to nano.

[1]+  Stopped                 nano confg/development.json

Then you are a complete idiot like me and need to ensure the values of c_user and xs in your development.json file are enclosed in quotes.

"c_user" : whateverthefuck
should be
"c_user": "whateverthefuck"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.