Two Thousand Fourteen is the year we all take back ownership of our data, or so I’ve been hearing, anyway. Whether or not that is any sort of official marching order for content creators for this year, it is a sentiment I can get behind.
For those of us creating content that we post online, why do post so much of it only to services which we have little to no control over the fate of? Services that we can’t pay money to use—even if we wanted to—so they reserve the right to use our content in ways that may be unsettling to us. Of course, I’m talking about services like Twitter, Facebook, and Instagram (nobody really uses Google+, right?).
Is all that content we’re creating so ephemeral that it’s not worth hanging on to?
Of the services I listed, Twitter is the only one I use with any regularity. My relationship with it has been pretty durable, too. I’ve been posting there regularly since 2008. I find value in occasionally going back over my old tweets when I remember that I posted something I found interesting, something which I’d like to dig up again because I can’t quite remember it. The trouble is, Twitter’s search is useless for searching through your tweet archive. There are other options to help with this problem, but they are somewhat clumsy tools, in that they retrieve and keep copies of what was posted to Twitter. They still don’t provide you with a sense of ownership of the content you authored and posted.
When I look at the body of content I’ve produced and posted to Twitter over the past 6 years as a whole, I begin to look at each of those items in that corpus less as tweets and more as short notes. In this view, it doesn’t make much sense to me to have Twitter be the canonical source of that content, particularly if it something I’m posting which I think may come in useful at a later date. It’s something I, as its author, should have the original source of. Because of this, going forward, I’ll be posting these short notes in the Notes section on this site.
I still love Twitter, though, and don’t want to leave it behind. It’s still valuable to me as a broadcast platform and a place for public conversation. I’d still like to post—or, rather, syndicate—my short notes there. That’s why I’ve implemented POSSE for them.
The rest of this post is going to be a bit more nuts-and-bolts oriented, seasoned with implementation details. If that sort of thing makes your eyes glaze over, feel free to stop reading. I won’t be offended.
POSSE is not a particularly new idea. A clumsy acronym though it is, it stands for Post on your Own Site, Syndicate Elsewhere. I first came across this idea last month in a piece by Chloe Weil in which she describes implementing POSSE on her own site to post short, Tweet-like entries and syndicate them to Twitter. Chloe is not the first to do this, though. Tantek Çelik has been at it since early 2010, and others have followed suit, not only with Tweets, but full blog posts, too.
The sort of moving parts POSSE requires in order to function aren’t available by default in Statamic, my CMS for this site. It does, however, offer a fairly robust API which you can utilize to author your own add-ons (Statamic parlance for plugins). So over the past few weeks, I’ve cobbled together a workable system for syndicating my short notes to Twitter.
The first thing I did was to set up the Notes section. I wanted to pre-populate it with my existing Twitter archive, creating one entry for each tweet in the archive. Twitter offers each user the ability to request an archive of their tweet history, so I did exactly that. Within a few seconds, I had a bunch of JSON files, each representing a month’s worth of tweets. Since I wanted each tweet to be an individual entry in the notes section, and Statamic expects each entry to be a Markdown file, I pieced together a PHP script which read through the JSON files and generated a .md file for each tweet. I quickly had over 2,200 .md files which I dropped into the new notes section1 and voilà—instant tweet archive2!
Now that the Notes section will be the canonical source of useful3 short-form content I write going forward, I needed to set up a way to syndicate new posts to Twitter. In order to make it all work, there were a couple of things I needed in place:
- Set up a way to auto-generate titles and slugs for each note.
- The ability to set up a short link to the post.
- A mechanism to post the entry to Twitter as a new tweet.
Moving on to the second point, one of the basic tenets of POSSE is the idea of original discovery. That is, when you post something and you syndicate it out, you provide some way to identify the original source of the content. Permashortlinks and their cousins, permashortcitations, are used to create references back to the original post. A permashortlink is a short URL points to the original post, typically rendered as a hyperlink. A permashortcitation is a unlinked, text only shortener of the permashortlink, and is included in a syndicated copy of a post when that copy of the post is displayed in its entirety. If you have a permashortlink like http://mub.io/KRyRb, the permashortcitation of it would look like (mub.io KRyRb)5. For the note at that permashortlink, you can see the permashortcitation in the POSSE‘d tweet.
Of course, to do that, I needed a short domain, so I purchased mub.io. I also needed a URL shortener service. In keeping with the ethos of owning your own content, I opted to build my own rather than tie the domain to an external URL shortener service. Once I had that up and running, I hooked into the publish event back in Statamic. I send the URL of the new post over to my domain shortener and get a short URL in return. It gets saved along with the post, as well as tacked onto the copy of the post that gets syndicated to Twitter. Which brings us to step 3.
If the post is short enough to be fully displayed as a tweet, the permashortcitation gets appended to the tweet, otherwise the permashortlink gets tacked on. This allows people who see the partial post as a tweet to follow the link back to the note on this site so they can read the whole thing. Of course, now that the tweet version of the post has been constructed, it needs to be posted to Twitter. I set up application-only auth credentials on Twitter so I could use its API to post new content to my timeline from this site. Using those credentials, I wrote a bit of PHP utilizing the awesome TwitterOAuth library which makes the post on my behalf when I publish a new note in Statamic. The response from that posting returns metadata about the new tweet, including its ID on Twitter. That ID gets saved along with the note so I can then create links to view, favorite, reply or retweet the syndicated tweet on Twitter from my original post.
Now that all that is in place, the process is complete. The note gets published here, it gets a shortlink and it gets syndicated out to Twitter. I have the original post in a Markdown file that I can keep as long as I have disk space to keep it on. POSSE, baby. It’s a bit of a rigmarole get it to work, but it feels good to have a sense of ownership.
I’ll refine the moving parts as I utilize this more, and am thinking of ways to POSSE more content, like my photos I post to Flickr. If you’ve done anything similar, I’d love to see it. Send me a tweet and let me know!
I did have some reservations over the potential performance hit of a dropping a few thousand entry files into Statamic for it to chew through. I considered using a database in which to store the notes, but was pleasantly surprised to see that the speed to load the pages averages around 2 seconds. Not exactly blazing, but still acceptable for now. I’d still like it to be faster, though. As Fred suggested, this sort of thing is an edge case for Statamic, and it would probably perform best with a database. Given that Statamic’s philosophy is to be a flat file CMS, that doesn’t feel right to me. I’m more inclined to implement a caching layer rather than add a database as a sidecar to a Statamic site. ↩
I’m not displaying @ replies in the short notes section, so that brought the archive of tweets I’m displaying from about 2250 down to around 1450. ↩
I don’t intend to post everything I would normally tweet as a note. Retweets, @-replies to people, and silly tweets like this one will by in large still get posted directly on Twitter. Things which I think may be useful or interesting both now and at a later date will get posted here as a Note and POSSE‘d to Twitter. ↩
The slug is the part of the URL, or address of a web page, that identifies a particular page within a section. In the case of this post, the section is journal and the slug is online-homesteading. ↩
The whole point of the format of a permashortcitation is that it doesn’t get converted to a link when it gets posted on a service like Twitter. If you syndicate a post to another service, it’s poor form to include a fully fledged link to the original post if the reader isn’t going to see any additional content when they follow the link. If they really want to, they can copy the permashortcitation without the parenthesis and replace the space with a slash. That turns it into the permashortlink, which will bring the reader to the original post. ↩