dylogger.rb is a ruby script for automatic generation of DayOne entries. This can be useful for lifelogging.
When correctly setup up it can collate data from multiple sources into either "streamed" or "single" DayOne posts.
It allows you to look back at your journal and think:
"Oh, I was reading that book back then, and listening to those songs. This is what I posted on Instagram, this is how many photos I took with my phone, this is a movie I watched."
It is inspired by siffter by Craig Eley and Gifttdy by GadgetComa. The former is written in ruby, and must be run on a schedule daily, whereas the latter is triggered by hazel. Both write DayOne entries directly into dropbox. Dylogger is a combination of the two - that is, its written in ruby (because AppleScript is very hard to change, maintain or understand - at least for me!) and run on a triggered basis using hazel... coz I like it that way.
###Overview
- hazel monitors a folder (it could be anywhere)
- when a file appears in there, it runs the dylogger.rb script
- the script parses the file and creates a DayOne entry in your Dropbox
###Installation
-
Place the dylogger.rb script wherever you like. It needs to be given permission to be executable. So you need to navigate to its location using terminal and then type
chmod +x dylogger.rb
(Ruby is installed by default in OSX Mavericks and Yosemite. If you have an older version of OSX you will need to install ruby. Just google it.)
-
Decide where your text and json files will be located. I use ~/Dropbox/Apps/IFTTT/dylogger but could be anywhere.
-
Setup hazel rules for this folder for txt and json files
###File types Currently, it can process two types of files
- text files, in the format used by giftttdy (more about this later)
- json files - currently only those produced by the iOS app reporter. Please suggest other JSON file formats you think should be supported by creating a github issue.
###File Sources The text files can come from many sources. Presently I generate them via IFTTT from a variety of triggers, and I also create them using Workflow an iOS app that can be used to do a whole range of things. I use it to create entries for movies I watch, and to enter my weight. It produces text files in dropbox that can then be parsed by dylogger.rb.
IFTTT can be used to create entries such as music tracks played on spotify (via track "scrobbling" performed by last.fm), books read on GoodReads and much more.
###Text file formats One of the strengths of dylogger is that you can use a multitude of sources to create the structured text and files it works on (and hopefully in the future, json files other than reporter files will be supported). You simply need to know the format, and get your source to produce the text file in this format.
The text files contain 6 pieces of data, separated by three "pipes" |||. For example:
Instagram Post|||Instagram|||April 13, 2015 at 02:52PM||| http://ift.tt/1IC7AZx |||Homemade friands|||Single
These pieces of data are
- The title of the "stream" that will be created (more later)
- tag for the DayOne entry
- date of the post
- an image (or "NOPIC")
- title of the entry
- whether its a "stream" or a "single" entry
###Stream vs Single If the final field is "TRUE" (legacy from giftttdy) or "stream", then dylogger will search for an existing entry for the day, and add it to the day's "lifestream", under the title of that stream. If this field is "single" then a new entry will be created for that file.
For example, it might make sense for each Instagram post, with its picture, or each movie, with a full description, to get a single DayOne entry. On the other hand, tracks played on spotify are better in a list of tracknames in a single post. Of course its up to you how you want to do it.
###Images As you may know, DayOne only allows a single image for each entry. Dylogger will use the first image it receives to add to a "stream", but new images will be lost.
###IFTTT recipes You can find receipes already created by GadgetComa on IFTTT by searching for "giftttdy"