hotalert/readme.md

52 lines
1.4 KiB
Markdown
Raw Normal View History

2022-11-03 20:04:14 +00:00
# Hot Alert
## Introduction
Hotalert is a command line tool that for task execution and configuration. Tasks and alerts are defined
in yaml files and the program parses the files, executes the tasks and emits alerts when the tasks conditions are met.
For example if you want to send a notification to your mobile phone when a keyword is found on a website you can use the
`webhook_discord` alerter and the `web_scrape` task function.
2022-11-03 20:04:14 +00:00
Example:
```yaml
tasks:
- options:
url: [...]
keywords: ["Episode 10", "Episode 11"]
timeout: 10
alerter: "webhook_discord"
function: "web_scrape"
2022-11-03 20:04:14 +00:00
alerts:
webhook_discord:
webhook: https://discord.com/api/webhooks/[...]
# $keywords can be used as a placeholder in the message, and it will be replaced with the actual keywords.
message: "Hi, the keyword(s) `$keywords` was found on [...]"
```
### Available task functions
#### web_scrape
The web_scrape task scrapes a web page by issuing a GET request and parses the response to look for keywords.
**Options**:
- url (string) - The url to scrape.
- keywords (array[string]) - A list of keyword strings to look for.
2022-11-03 20:04:14 +00:00
### Development
To build the program for Linux under Linux use the following command:
```bash
GOOS=linux GOARCH=arm64 go build
```
If you're using Windows use:
```bash
$env:GOOS = "linux"
$env:GOARCH = "arm"
$env:GOARM = 5
go build -o hotalert .
```