Esempio n. 1
0
func notifyProwl(n notifier, note notification) (err error) {
	p := goprowl.Goprowl{}
	p.RegisterKey(n.Config["apikey"])

	msg := goprowl.Notification{
		Application: n.Config["application"],
		Description: note.Msg,
		Event:       note.Event,
		Priority:    n.Config["priority"],
	}

	return p.Push(&msg)
}
Esempio n. 2
0
func notifyProwl(n notifier, note notification) error {
	p := goprowl.Goprowl{}
	if err := p.RegisterKey(n.Config["apikey"]); err != nil {
		return err
	}

	msg := goprowl.Notification{
		Application: n.Config["application"],
		Description: note.Msg,
		Event:       note.Event,
		Priority:    n.Config["priority"],
	}

	return p.Push(&msg)
}
Esempio n. 3
0
func main() {
	flag.Parse()

	p := goprowl.Goprowl{}
	p.RegisterKey(apikey)

	n := goprowl.Notification{
		Application: application,
		Description: strings.Join(flag.Args(), " "),
		Event:       event,
		Priority:    priority,
		Url:         url,
	}

	if err := p.Push(&n); err != nil {
		fmt.Fprintf(os.Stderr, "Error sending message:  %v\n", err)
		os.Exit(1)
	}
}