njuhalo

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2017 License: MIT Imports: 3 Imported by: 0

README

new(/njuː/)halo

Go Report Card

Njuh njuh

Njuhalo is watcher written in Go. It watches popular online store Njuškalo.hr and notifies owner for new occurrences of wanted items that match filters in config. That way you can

Usage

NAME:
   njuhalo - Watch Njuskalo better than anyone

USAGE:
   njuhalo [global options] command [command options] [arguments...]

VERSION:
   1.0.0

COMMANDS:
     init, initialize, i  initialize configuration and database file in home dir
     start, serve, s      start monitoring njuskalo for items
     add, query, a        adds query to watch to config
     print, p             Prints currently active config file
     help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config value, --con value  PATH to config file (default: "$HOME/.njuhalo/config.json")
   --help, -h                   show help
   --version, -v                print the version

You need to configure your watcher how often do you want to run it. Supported alerting channels are email and slack.

You can customize queries and filters so as intervals between fetching each page, because you don't want to send too many requests and act as an idiot.

Configuration

Configuration file looks like this:

{
	"runIntervalMinutes": 1,
	"sleepIntervalSeconds": 2,
	"queries": [{
		"baseQueryPath": "iznajmljivanje-stanova/zagreb",
		"filters": {
			"locationId": "2619",
			"price[max]": "260",
			"mainArea[max]": "50"
		}
	}],
	"slack" : true,
	"slackToken": "",
	"slackChannelId" : "",
	"slackNotificationColor": "#fdcd00",
	"mail": true,
	"to": "myemail@gmail.com",
	"mailgunDomain":"",
	"mailgunAPIKey":"",
	"mailgunPublicKey":""
}

It can be found in: {$HOME}/.njuhalo

If there is no such file you can create it manually or just run: /.njuhalo i

Adding queries

Adding queries can be pain in the ass so you can simply paste it like this

/.njuhalo a http://www.njuskalo.hr/path?query=1&query=2

That will parse query and save it to the default config file.

Number of queries is not limited and you can add as much as you want.

Development

Location of all njuhalo config and db is in your home folder

{$HOME}/.njuhalo

To build binary from scratch:

go build


MIT License

Copyright (c) Lovro Predovan 2017

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL