Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/borkdude/balcony
Should I water my balcony?
https://github.com/borkdude/balcony
clj clojure command-line-tool
Last synced: 4 months ago
JSON representation
Should I water my balcony?
- Host: GitHub
- URL: https://github.com/borkdude/balcony
- Owner: borkdude
- License: mit
- Created: 2018-05-21T09:17:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T18:33:54.000Z (over 6 years ago)
- Last Synced: 2024-09-29T21:02:24.304Z (4 months ago)
- Topics: clj, clojure, command-line-tool
- Language: Clojure
- Homepage:
- Size: 38.1 KB
- Stars: 23
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# balcony
A self-contained Clojure script that lets me know if I should water my
balcony at night.## Credits
The idea to use `exec` came from [Planck](https://github.com/planck-repl/planck).
## Installation
Make sure [clj](https://clojure.org/guides/getting_started) is installed. `scp`
the script to a server or run from your own machine. Set the variables
`MAIL_USER`, `MAIL_PASS`, `MAIL_TO` (comma seperated if you want multiple
addresses) and `WEATHER_API_KEY` in e.g. `.profile`. Then hook the script up in
cron:crontab -e
30 19 * * * /usr/bin/env bash -c '. $HOME/.profile && $HOME/balcony.clj -m'## Options
- `--develop` or `-d`: development mode. Will start CIDER-nREPL.
- `--mail` or `-m`: send an email if today's temperature exceeded threshold.## What's with the weird first few lines?
The first few lines are relevant to bash, but not to the Clojure program. Still
they have to be valid Clojure, because (using exec) clj executes the entire
file. Also, it's convenient to be able to evaluate your entire file inside your
editor. By making the Bash expressions readable by Clojure, you get no errors.