https://github.com/lardissone/DayOneLogger
Log anything you add to a folder to Day One. Ideal to use with IFTTT.
https://github.com/lardissone/DayOneLogger
Last synced: 5 months ago
JSON representation
Log anything you add to a folder to Day One. Ideal to use with IFTTT.
- Host: GitHub
- URL: https://github.com/lardissone/DayOneLogger
- Owner: lardissone
- License: mit
- Created: 2014-09-06T01:22:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-05T13:37:07.000Z (over 10 years ago)
- Last Synced: 2024-08-08T00:44:14.691Z (8 months ago)
- Language: Python
- Homepage:
- Size: 152 KB
- Stars: 10
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- project-awesome - lardissone/DayOneLogger - Log anything you add to a folder to Day One. Ideal to use with IFTTT. (Python)
README
# DayOneLogger
Log anything you add to a folder to Day One. Ideal to use with IFTTT. Inspired in [Sifttter](http://craigeley.com/01-07-2014/sifttter-an-ifttt-to-day-one-logger/) and [Slogger](http://brettterpstra.com/projects/slogger/).
## How does it works
**DayOneLogger** is an script that runs daily (or in the time period you define) and automatically checks for new entries on different files in the defined directory.
The files must contain an specific format:|~|@done
The date need to be in the format `September 05, 2014 at 03:06PM` (the one used by IFTTT).
The separator `|~|` is just to separate each content of the entry. You can add as many separators as you need, later the parser will do the magic understanding what each content means.
And finally you need to add the ending token identified as `@done`, to inform the parsers where an entry finish.Example from a completed reminder in Reminders iOS app:
September 05, 2014 at 03:05PM|~|Reminders|~|Buy milk @done
The script only stores on Day One all entries from previous day and before, it's intentionally done to avoid miss last time entries.
It also logs previous unimported days.
The resulting entry looks like:
## Installation
Clone the repository:
git clone https://github.com/lardissone/DayOneLogger.git
The only requirement is the beautiful [Arrow](http://crsmithdev.com/arrow/) library, but if you want more control you can install it using a `virtualenv`.
Install requirements (requires `pip`):
pip install -r requirements.txt
## Configuration
You need to edit a few settings in the source of the `dayone.py` file:
- `IFTTT_DIR`: set the relative directory to where you store the logging files
- `DAYONE_DIR`: uncomment the corresponding option. If you have syncing with iCloud or Dropbox.
- `TIME_ZONE`: set your local timezone to include the correct time. You can find the list of all timezones in [Wikipedia](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Note: it should be automatic, but `tzlocal` library doesn't works well in OSX with some specific zones.
- `TIME_ZONE_OFFSET`: it's the number of difference in hours from `UTC`. It's also something we should calculate automatically, probably in the future.
- `ENTRY_TAGS`: a list with the tags to be used in each entry.- `SERVICES`: a list with the services you want to process. Review each service file in the `services` folder in case you need to do custom modifications, actual services are:
SERVICES = [
'github',
'reminders',
'movies',
'places',
'tracks',
'tweets',
'wakatime',
'todoist',]To run the script you just need to call it from the terminal by using:
python dayone.py
To make it effective you should add it to a cron or launchd script.
## Parsers
Currently here are a few of parsers I've created for my pleasure, all of them uses [IFTTT](https://ifttt.com/) to generate the data from my other services.
You can simply use any of these recipes with your services. Remember to change the settings according to your setup.
### Github
Use your activity atom feed URL, which is: `https://github.com/yourusername.atom`
### Reminders (iOS app)
Log all your completed tasks in the Reminders app. You need the IFTTT app installed in your phone.
Log all your Twitter activity.
### IMDb rated movies
It's a little more tricky to obtain. Log in to IMDb, and go to your Ratings, and you'll see the feed icon to the upper right of the page, use this URL.
### Foursquare
Log all the places you visits.
### Last.fm loved tracks
Log all your loved tracks.
### Todoist completed tasks
Log all the tasks you've completed.
### Wakatime worked hours
Log how much time did you spend in each project using [Wakatime](https://wakatime.com/).
You need to create an environment variable called `WAKATIME_API_KEY` with your Wakatime API key, or add it to the `services/wakatime.py` file.
## TO DO
- Add tests
- Add documentation about launchd, cron, etc.
- Isolate parsers
- Allow editing previous entries
- Find a way to get current timezone in OSX. `tzlocal` library is pretty buggy with some locations## Author
This simple script was created by [Leandro Ardissone](https://github.com/lardissone). Feel free to contact me on [Twitter](http://twitter.com/Leech) or leave [issues](https://github.com/lardissone/DayOneLogger/issues) in github with suggestions/bugs/etc.