From aca63763abe6cad1924730afd09ecbfc8fae90d9 Mon Sep 17 00:00:00 2001 From: Felix Hoffmann <19827840+zzzFelix@users.noreply.github.com> Date: Tue, 26 Sep 2023 00:15:16 +0200 Subject: [PATCH] docs: better installations instructions --- README.md | 24 ++++++++++++------------ sanitize.go | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8413dfe..af3187e 100644 --- a/README.md +++ b/README.md @@ -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: `Link` 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. \ No newline at end of file + - `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: `Link` is sanitized to `Link`. All whitespace (including tabs and line breaks) is also removed. + diff --git a/sanitize.go b/sanitize.go index 71e0c7e..46347c8 100644 --- a/sanitize.go +++ b/sanitize.go @@ -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)