dailyc is a service for sending multimedia messages and emails at regular
intervals. You provide dailyc with a folder full of jpgs and a list of
messages; it will determine which image and message hasn't been sent in a while
(if ever) and fire it off to a list of subscribers.
The service works really well for sending baby pictures to adoring (petulant?) relatives. It is well suited to this task because, well, that's why I implemented it.
You'll need to pull dailyc down:
git clone git@github.com:JLospinoso/dailyc.git
You must edit two files to get dailyc up and running. First is
application.properties, which you can find here in
dailyc/dailyc-core/src/main/resources/
Set each value as appropriate. As [noted in this blog post], you'll need to
sign up for both a Mogreet account and have SMTP access to a mail server.
Optionally, you can configure dailyc to persist state into a database. The
default is to use the in-memory only database h2
The other file to edit is config.json. You can move this file wherever you
like, so long as application.properties points to it correctly, e.g.
configPath=/home/johndoe/config.json
This file can be changed at runtime without recompiling/restarting/etc. The batch process picks this file up off disk just in time for processing.
{
"imageDirectory": "../img",
"subscribers": [
"5551234567"
],
"emailSubscribers": [
"dailyc@lospi.net"
],
"messages": [
"Hello world!",
"Foo!"
]
}
Finally, you'll need to fill a (flat) directory with .jpg files. This
directory should be pointed to by config.json (as above). At runtime,
dailyc will scoop all the images out of this directory, compare their hashes
with what it's persisisted in the database, and commit any new ones--so you can
add images as you like without having to restart the service (same with
messages, which you type directly into config.json).
Gradle manages the entire build process, to include dependencies. You can use the gradle wrapper and start the service:
gradlew bootRun
That should do it!