Giter Site home page Giter Site logo

zzzfelix / wbmalert Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 4.44 MB

Takes a list of websites, makes a request to each website every 30 seconds, and plays a notification sound when the contents of a website have changed.

License: MIT License

Go 100.00%
hacktoberfest

wbmalert's People

Watchers

Felix Hoffmann avatar

Forkers

dowlatabadi

wbmalert's Issues

Replace audio library

The script currently makes use of github.com/faiface/beep to play a notification sound.

To reduce external dependencies, the library could be reduced with something else. All it needs to do is get the user's attention. A full blown audio library might be overkill.

Properly embed sound file

The success.mp3 file is embedded but not used for playback in sound_darwin.go. Sound only plays when the file exists in the current path lol.

Better error handling

In case of an error, the snapshot updates with the string error. The alert is fired when the error occurs and it fires again when it doesn't occur anymore. This results in two, unnecessary success notifications. Errors should be either ignored or result in a different notification.

Get "https://www.wbm.de/wohnungen-berlin/angebote/": net/http: TLS handshake timeout
An error occurred! The website could not be reached!
========= WBM =========
Content changed: https://www.wbm.de/wohnungen-berlin/angebote/
=======================

Replace HTML Sanitization library

The script uses github.com/microcosm-cc/bluemonday to sanitize the retrieved HTML. This is only done because some websites contain generated strings/tokens (e.g. for Google Analytics or as references to dynamically created JS/CSS) that need to be removed.

To reduce external dependencies, an internal solution to remove these strings is required. Doesn't have to be HTML sanitation.

External configuration

The configuration (websites, interval) is currently hard-coded in the go program code. This could be in an external file.

Sound for Windows

Currently, sound only works on macOS. It's implemented using the operating system's afplay command. I would prefer not to pull in any libraries.

Add regex remove feature

  • Some websites have ever-changing parts (like date/time)
  • An additional property in configuration.json should allow for a regular expression that removes those parts

Sound for Linux

Currently, sound only works on macOS. It's implemented using the operating system's afplay command. Linux has a similar aplay command. I would prefer not to pull in any libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.