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
- Command to edit configuration file
- Repeat URL check N times and exit
- Per-URL configuration via JSON configuration file
- Run a custom command on change detection
Changed:
- Configuration is now in JSON format
- Combined URL configuration with new JSON configuration format
- Intervals are now available in seconds, minutes, hours
- Dependencies now include timeout
- Desktop notification default is now false
- Reorganized code for maintainability and logic
Removed:
- Support for bash based configuration files
- Separate URL file
Fixed:
- Console logging formatting errors
- All paths are now normalized
Copy file name to clipboardExpand all lines: README.md
+79-37Lines changed: 79 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ NoirWatch monitors specified websites for changes and sends notifications. It su
21
21
-[x] Send notifications via Pushover
22
22
-[x] Send notifications via native desktop notifications (macOS, Linux, Windows)
23
23
-[x] Run as a background service
24
-
-[ ] Run the check a specific number of times and then exit
24
+
-[x] Run a custom script on change detection
25
+
-[x] Run the check a specific number of times and then exit
26
+
-[x] Robust configuration using JSON which includes per URL options
25
27
-[ ] Output change averages for all urls
26
28
-[ ] Add averages to notifications
27
29
-[ ] Full historical average change report
@@ -32,6 +34,7 @@ NoirWatch monitors specified websites for changes and sends notifications. It su
32
34
- Bash 4.0+
33
35
-`curl` for fetching website content
34
36
-`sed` for HTML content normalization
37
+
-`timeout` for custom command files
35
38
-`xmllint` for HTML content normalization
36
39
-`powershell` for Windows desktop notifications
37
40
-`notify-send` for Linux desktop notifications
@@ -291,22 +294,43 @@ NoirWatch uses a configuration file to store default settings. The default locat
291
294
292
295
### Example Configuration File
293
296
294
-
```bash
295
-
# NoirWatch Configuration File
296
-
CACHE_DIR="/tmp/noirwatch_cache"
297
-
LOG_FILE="/tmp/noirwatch_cache/noirwatch.log"
298
-
CONFIG_FILE="~/.config/noirwatch.conf"
299
-
URL_FILE="~/.config/noirwatch_urls.conf"
300
-
CHECK_INTERVAL=15
301
-
TIMEOUT=5
302
-
SYSTEM_NAME="My System"
303
-
PUSHOVER_NOTIFICATION=false
304
-
PUSHOVER_USER_KEY=""
305
-
PUSHOVER_API_TOKEN=""
306
-
DESKTOP_NOTIFICATION=true
307
-
VERBOSE=false
308
-
LOG_LEVEL="INFO"
309
-
THRESHOLD=0
297
+
```json
298
+
{
299
+
"configuration": {
300
+
"CACHE_DIR": "/tmp/noirwatch_cache",
301
+
"LOG_FILE": "/tmp/noirwatch_cache/noirwatch.log",
302
+
"CHECK_INTERVAL": "60s",
303
+
"TIMEOUT": "5s",
304
+
"SYSTEM_NAME": "Test System",
305
+
"PUSHOVER_NOTIFICATION": "false",
306
+
"PUSHOVER_USER_KEY": "",
307
+
"PUSHOVER_API_TOKEN": "",
308
+
"DESKTOP_NOTIFICATION": "false",
309
+
"VERBOSE": "true",
310
+
"LOG_LEVEL": "DEBUG",
311
+
"THRESHOLD": "0"
312
+
},
313
+
"urls": {
314
+
"default": [
315
+
{
316
+
"NAME": "Apple Newsroom",
317
+
"URL": "https://www.apple.com/newsroom/",
318
+
"TIMEOUT": "5s",
319
+
"THRESHOLD": "1",
320
+
"UPDATED_CMD": "./test/test_cmd.sh",
321
+
"CMD_TIMEOUT": "5s"
322
+
},
323
+
{
324
+
"NAME": "9to5mac Homepage",
325
+
"URL": "https://9to5mac.com",
326
+
"TIMEOUT": "10s",
327
+
"THRESHOLD": "5",
328
+
"UPDATED_CMD": "./test/test_cmd.sh",
329
+
"CMD_TIMEOUT": "5s"
330
+
}
331
+
]
332
+
}
333
+
}
310
334
```
311
335
312
336
## Options
@@ -344,16 +368,12 @@ THRESHOLD=0
344
368
-`-o, --output <file>`: Specify a custom log file location.
345
369
-`-L, --log-level <level>`: Set the log level (FATAL, ERROR, WARN, INFO, DEBUG).
346
370
347
-
### URL Management
348
-
349
-
-`-f, --url-file <file>`: Specify a file containing a list of URLs to monitor.
350
-
-`-U, --list-urls`: List all watched URLs.
351
-
352
371
### Remote Connection Configuration
353
372
354
373
-`-i, --interval <minutes>`: Set the interval between checks (default is 15 minutes).
355
374
-`-T, --timeout <seconds>`: Set the timeout for ping and DNS tests (default: 5 seconds).
356
375
-`-H, --threshold <percentage>`: Set the threshold percentage for detecting changes (default: 0%).
376
+
-`-U, --list-urls`: List all watched URLs.
357
377
358
378
### Process Management
359
379
@@ -383,21 +403,43 @@ Ensure you have the following installed on your system:
383
403
384
404
2.**Update the Test Configuration File:** Open the test_noirwatch.conf file in your preferred text editor and ensure it contains the following configuration:
385
405
386
-
```bash
387
-
# NoirWatch Configuration File
388
-
CONFIG_FILE="./test_noirwatch.conf"
389
-
URL_FILE="./test_urls.conf"
390
-
CACHE_DIR="./test_cache"
391
-
LOG_FILE="./test_noirwatch.log"
392
-
CHECK_INTERVAL=1
393
-
TIMEOUT=5
394
-
THRESHOLD=1
395
-
SYSTEM_NAME="test system"
396
-
BACKGROUND=false
397
-
PUSHOVER=false
398
-
DESKTOP=false
399
-
VERBOSE=true
400
-
LOG_LEVEL="DEBUG"
406
+
```json
407
+
{
408
+
"configuration": {
409
+
"CACHE_DIR": "./test/cache",
410
+
"LOG_FILE": "./test/cache/noirwatch.log",
411
+
"CHECK_INTERVAL": "60s",
412
+
"TIMEOUT": "5s",
413
+
"SYSTEM_NAME": "Test System",
414
+
"PUSHOVER_NOTIFICATION": "false",
415
+
"PUSHOVER_USER_KEY": "",
416
+
"PUSHOVER_API_TOKEN": "",
417
+
"DESKTOP_NOTIFICATION": "false",
418
+
"VERBOSE": "true",
419
+
"LOG_LEVEL": "DEBUG",
420
+
"THRESHOLD": "0"
421
+
},
422
+
"urls": {
423
+
"default": [
424
+
{
425
+
"NAME": "Apple Newsroom",
426
+
"URL": "https://www.apple.com/newsroom/",
427
+
"TIMEOUT": "5s",
428
+
"THRESHOLD": "1",
429
+
"UPDATED_CMD": "./test/test_cmd.sh",
430
+
"CMD_TIMEOUT": "5s"
431
+
},
432
+
{
433
+
"NAME": "9to5mac Homepage",
434
+
"URL": "https://9to5mac.com",
435
+
"TIMEOUT": "10s",
436
+
"THRESHOLD": "5",
437
+
"UPDATED_CMD": "./test/test_cmd.sh",
438
+
"CMD_TIMEOUT": "5s"
439
+
}
440
+
]
441
+
}
442
+
}
401
443
```
402
444
403
445
3.**Update the Test URL File:** Open the test_urls.conf file in your preferred text editor and ensure it contains the following URLs:
0 commit comments