Skip to content

Commit

Permalink
docs: better installations instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzFelix committed Sep 25, 2023
1 parent f98b16b commit aca6376
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# wbm-alert
This script creates (text) snapshots for a given list of websites. A request to each website is made every 30 seconds. If the contents of the website have changed, a notification sound is played.

## Limitations
The snapshot only considers the textual contents of a website. If images, links, or HTML attributes change, the alarm may not sound. In more technical terms: `<a href="https://google.com">Link</a>` is sanitized to `Link`. All whitespace (including tabs and line breaks) is also removed.

## What is it good for?
I used it to monitor real estate websites to be notified of new listings. I was particularly interested in Berlin's state-owned Wohnungsbaugesellschaft Berlin-Mitte (WBM), hence the name `wbm-alert`.

## Prequisites
Go >= `1.21`, older versions may work but aren't tested.

## Get started
- Clone the repo
- Adjust `configuration.json`: Edit the `websites` array to contain your own links.
- Optionally adjust the interval
- Install and run the program `go install && wbmalert -c configuration.json`
## Usage
- Create a `configuration.json` file, use the one from this repository as a template. Also see [configuration options](#configuration-options).
- Install: `go install github.com/zzzFelix/wbmalert@latest`
- Run the script and provide the path to your configuration: `wbmalert -c configuration.json`

## Configuration options
- `interval`: Time in seconds between requests
- `websites`: Array of websites to make requests to.
- `name`: Name to identify the website. Does not need to be unique.
- `url`: Url to make HTTP GET request to.
- `regexRemove` (optional): A regular expression. Removes every substring that matches.
- `regexRemove` (optional): A regular expression. Removes every substring that matches.

## What is it good for?
I used it to monitor real estate websites to be notified of new listings. I was particularly interested in Berlin's state-owned Wohnungsbaugesellschaft Berlin-Mitte (WBM), hence the name `wbm-alert`.

## Limitations
The snapshot only considers the textual contents of a website. If images, links, or HTML attributes change, the alarm may not sound. In more technical terms: `<a href="https://google.com">Link</a>` is sanitized to `Link`. All whitespace (including tabs and line breaks) is also removed.

2 changes: 1 addition & 1 deletion sanitize.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func removeAllWhitespace(str string) string {
}, str)
}

// Uses https://stackoverflow.com/a/64701836
// See https://stackoverflow.com/a/64701836
func stripTags(s string) string {
var builder strings.Builder
builder.Grow(len(s) + utf8.UTFMax)
Expand Down

0 comments on commit aca6376

Please sign in to comment.