Update: Slogger 2 development is on Github.

I’m prepping for a very busy week next week, and I won’t be able to put any more time into this project for a bit. I wanted to share it, though, so I present to you—in a beta state—Slogger.

Yes. Slogger.

Slogger is short for Social Logger. It’s a horrible name. Horrible. This is by design. I don’t want you to like it very much because I’m not going to be supporting it. You are free to play with it, modify it, ruin your lives with it, but you’re on your own for now. I will answer occasional Twitter and email questions. I can’t help doing it. It’s why I’m going to die young1.

What is it, already?

This is an extensible system for logging your online social life using Day One. You remember Day One, right? I just wrote about it. I’ve been doing a lot of automated logging to Day One for nerdy, worky stuff. I wanted my journal to be a little more colorful without any extra effort on my part2. So this is how I’m doing it.

Slogger Screenshot

Slogger does the following:

  • Turns any image you can grab with IFTTT into a log entry using Hazel, Folder Actions or launchd (built in to Mac OS X).
  • Checks multiple Twitter Feeds for new, non-reply updates and favorites
    • This happens every 24 hours as a digest to avoid flooding your log (because we all talk too much)
    • If it finds recognized image links in these posts, they become their own post with image.
    • It will convert all links found in the text into Markdown, which displays quite nicely in Day One
  • It will check any number of RSS feeds for new posts, primarily intended to log your own posts on your blog or blogs you write for. If you can pull a feed of it, you can log it
    • The first image in the post will be added to the entry for that post
    • Entries are dates by their publish date, not the time the script runs
  • If you give it a Last.fm username, it will grab your playlist and loved tracks for the day
  • If you give it a Github Gist username, it will create links to any Gists you’ve posted for the day

Using IFTTT, you can grab Instagram, Flickr, Facebook and other images for adding. You can even have it add a picture when someone tags you in a Facebook photo. Assuming you don’t have a bunch of jackass friends who tag you in pictures that are completely unrelated to your life, that can be pretty cool.

Stranger Danger

No strangers. No one sees this journal but you, and there are no passwords or authentication required. This is because it only works with public data. Your personal private stuff should probably be entered in your own journal, yourself, right?

However, this is a word of warning: I’m not using the CLI tool to do this, but rather creating XML files directly. I may swap over at some point, but just be aware that this is sticking bits into your journal all by itself. I have seen ZERO problems with this method and have been doing it daily for months. However, I take no responsibility for what it does to YOUR journal. Just so we’re clear.

How does it work?

It’s a script3. Actually, it’s two scripts, one to be run by Hazel or launchd when a folder changes (images) and one to be run on a schedule (every 24 hours) to grab everything else.

If you happen to use iCloud sync in Day One and you don’t want to log anything but IFTTT images, pop up Hazel and go. You’re done. If you want to use the rest of it, though, you have to get your hands dirty. I might eventually package this up into a binary or make a package installer, but c’mon, I have a day job.

Download the folder below and place it anywhere on your drive. You’ll need to open Terminal and cd to the folder. From within that folder, run the slogger command once:

/usr/bin/ruby slogger

It will tell you to edit the configuration file (it just made it when you did that). Open slogger_config in the same folder in any text editor. Add options to the services you want to use, and comment or delete lines for services you don’t. My config file looks like this:

---
storage: icloud

lastfm_user: ttscoff
lastfm_tags: @social @music

rss_feeds: [	http://feeds.feedburner.com/BrettTerpstra,
			 	http://www.tuaw.com/editor/brett-terpstra/rss.xml ]
rss_tags: @social @writing
markdownify_rss_posts: true
star_rss_posts: true

twitter_users: [ ttscoff, MarkedApp ]
twitter_tags: @social @twitter
save_images: true
droplr_domain: ckyp.us

gist_user: ttscoff
gist_tags: @social @coding

The storage key is important. If you use iCloud, just leave it alone. If you’re on Dropbox or other, you need to enter the path to the Journal.dayone folder on your drive. It would look like ~/Dropbox/Journal.dayone.

the _tags fields are tags that will be added to every post for you. You can leave them blank or delete the line if you don’t want that. I use it for sorting and maintainability, especially since there’s not a great way to switch between multiple diaries and my work/play journals neither work nor play well together.

Note that you can only have one Last.fm user and one Gist user, but you can add as many Twitter users and RSS feeds as you desire. Also note the option to Markdownify your RSS posts into clean text and links, and to star them so they stand out. Just my personal preference, thought I’d make it an option.

The droplr_domain key is for people who use a custom domain with Droplr. It allows the script to recognize uploads found in your Twitter stream and try to add them to your timeline. No guarantees on that yet, either.

Once you have that all set up, it’s ready to test. Run the slogger command again from within its folder: /usr/bin/ruby slogger. It should let you know which services it’s checking and when it’s done. Note that most of the text updates show up immediately in Day One (and as of the current version, they sync to iCloud instantly). The photo updates sometimes require a restart of Day One to register. If I swap this over to the CLI, I might be able to avoid that, or there might be a trick I haven’t figured out. I will figure it out.

Scheduling

Slogger runs once a day. It gathers that day’s activity and puts it in your journal. RSS posts are inserted at their publish time, digests go in at the time the script is run. I recommend you run it at 11:50pm. Everything is set to look back a full 24 hours, so whatever time you schedule it for, it will pick up what’s happened since the last run.

Now, if everything has gone as planned, you’ll want to schedule it. If you already have a script-scheduling system of some kind, go for it, but only run it once a day. Anything more and you’ll grow hair on your palms. If you want to use launchd, there’s an install.rb file in the Slogger folder that will set up a launchd task for you automatically. You can adjust the resulting task by editing ~/Library/LaunchAgents/com.brettterpstra.slogger, or by just getting Lingon. Seriously, why don’t you have Lingon yet?

Update: As noted by Leo in the comments, the App Store version of Lingon cannot modify the necessary file mentioned in this post. I always forget that I resisted the upgrade for this reason. Use the install.rb script with sudo to circumvent this, and edit by hand if needed.

The image saving is most easily implemented with Hazel. Build an IFTTT.com recipe to grab images from somewhere and save them to your Dropbox folder. Then set up a Hazel task to watch for new image files, run the shell script (slogger_image.rb) and then process them however you like. The script will not harm your images, nor do anything other than copy them, convert if necessary, size them down and make them into journal entries. That’s all. Any file-moving or tagging or processing of the original image should be handled by Hazel. Note: the image script must be run from within the Slogger folder. Don’t be all smarty-pants and try to move it. You can, however, put that folder wherever you like.

There is, I guarantee, plenty I forgot to mention. It’s actually ok, you can ask me about it. Just be nice.

So that’s it. The Social Logger. Slogger. Have fun. Oh, and you’ll want to grab Day One, too.

Update: I uploaded v1.0.3, with a fix for Ruby 1.9+ and hopefully a solution for the RSS feed problems. Let me know how it goes.

Update 2: Slogger 2 has begun development. I’m leaving this download here because it works, but you might want to check out the rewritten version 2.

[Download Slogger on GitHub.]

  1. Up until I was 25, I was certain I would be dead by 22. Three years on borrowed time and I gave up. Now I wonder how old you can be and still die young? 

  2. No, the six hours I’ve put into this so far do not count as extra. 

  3. Not even a well-constructed script, yet, but it’s been stable for me for the last day of testing.