You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-24
Original file line number
Diff line number
Diff line change
@@ -3,42 +3,42 @@
3
3
Proof of concept about tracking contacts in WhatsApp.
4
4
Check out my [blog entry](https://jorislacance.fr/blog/2020/04/01/whatsapp-tracking) for in-depth info.
5
5
6
-

6
+

7
7
8
8
## architecture
9
9
10
10
The POC is composed of:
11
11
12
-
* The Node.js WhatsApp scraper robot - Gather the data
13
-
* The InfluxDB 2.0 service - Store the data
14
-
* The Grafana 6.7 service - Visualize the data
12
+
- The Node.js WhatsApp scraper robot - Gather the data
13
+
- The InfluxDB 2.0 service - Store the data
14
+
- The Grafana 6.7 service - Visualize the data
15
15
16
16
## setup
17
17
18
18
```bash
19
19
# run the InfluxDB and Grafana services
20
-
docker-compose up -d
20
+
docker-compose up -d influxdb grafana
21
21
```
22
22
23
23
### influxDB setup
24
24
25
-
* Go to [http://localhost:9999](http://localhost:9999), setup an admin account
26
-
* Name the initial organization like you want, `initial-org` for instance
27
-
* Name the initial bucket anything, like `yolo`, we won't use the initial one because there will be sample data in it
28
-
* Create a new bucket `whatsapp-tracking`
29
-
* Generate a token `whatsapp-tracking-scraper` with write permission to `whatsapp-tracking` bucket
30
-
* Generate a token `grafana` with 'all access'
25
+
- Go to [http://localhost:9999](http://localhost:9999), setup an admin account
26
+
- Name the initial organization like you want, `initial-org` for instance
27
+
- Name the initial bucket anything, like `yolo`, we won't use the initial one because there will be sample data in it
28
+
- Create a new bucket `whatsapp-tracking`
29
+
- Generate a token `whatsapp-tracking-scraper` with write permission to `whatsapp-tracking` bucket
30
+
- Generate a token `grafana` with 'all access'
31
31
32
32
### grafana setup
33
33
34
-
* Go to [http://localhost:3000](http://localhost:3000), setup an admin account
35
-
* Add the data source using the plugin `Flux (InfluxDB) [BETA]` (for InfluxDB 2.0)
36
-
* URL: `http://influxdb:9999`
37
-
* with credentials: `true`
38
-
* Organization: `initial-org`
39
-
* Default Bucket: `whatsapp-tracking`
40
-
* Token: the grafana token
41
-
* Import the dashboard (file `grafana-dashboard.json`)
34
+
- Go to [http://localhost:3000](http://localhost:3000), setup an admin account
35
+
- Add the data source using the plugin `Flux (InfluxDB) [BETA]` (for InfluxDB 2.0)
36
+
- URL: `http://influxdb:9999`
37
+
- with credentials: `true`
38
+
- Organization: `initial-org`
39
+
- Default Bucket: `whatsapp-tracking`
40
+
- Token: the grafana token
41
+
- Import the dashboard (file `grafana-dashboard.json`)
42
42
43
43
### scraper setup
44
44
@@ -51,19 +51,23 @@ INFLUXDB_ORG=initial-org
51
51
INFLUXDB_BUCKET=whatsapp-tracking
52
52
```
53
53
54
-
## scraper usage
54
+
## scraper usage Windows
55
55
56
-
```bash
56
+
```powershell
57
57
# init the robot
58
58
npm install
59
59
# run the robot
60
60
node index.js
61
61
```
62
62
63
-
## limitation
63
+
## scraper usage docker
64
64
65
-
Not sure if the scraper runs on Linux...
65
+
```bash
66
+
docker-compose up scraper
67
+
# Look at `./data/screenshots/` to get the QR code peering.
68
+
```
66
69
67
70
## todo
68
71
69
-
* Dockerize the scraper too ? Hardly with the peering procedure that requires us to scan the QR code.
72
+
-[x] Dockerize the scraper too ? Hardly with the peering procedure that requires us to scan the QR code. -> screenshot through file system
73
+
-[ ] Track several contacts by rotating the contact tracked every hours or so (we will loose the precise `online` state tracking but gather more `last seen` data)
0 commit comments