GithubHelp home page GithubHelp logo

balcony's Introduction

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.

Installation

Make sure clj 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.

balcony's People

Contributors

borkdude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

clojure-land

balcony's Issues

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.