22 posts tagged Tumblr

RedHanded » Stop, For Blogging's Sake

Blogging has mutated into simpler forms (specifically, link- and mob- and aud- and vid- variant), but I don’t think I’ve seen a blog like Chris Neukirchen’s Anarchaia, which fudges together a bunch of disparate forms of citation (links, quotes, flickrings) into a very long and narrow and distracted tumblelog. A good idea and I’m sure more of these will be showing up. Maybe you know of others?

Reminder that the format was reified by Ruby programmers.

You can still run Hobix.

The basic points behind Hobix are:

  • Your blahhg or websyht is made up of some thing.
  • That some thing might be news entries, pix, keynote addresses, spreadsheets.
  • The first page of your blahhg shows the latest some thing.
  • Any some thing can be simplified for the first page.
  • Beyond that, each some thing gets it own page.

Backup your Tumblr with tumblr-rb v2.1.0

In light of some of the recent headlines surrounding a Tumblr acquisition, I’ve just hastily written and released an update to tumblr-rb — my command line utility and library for the Tumblr API.

I’ve added a new command in this version: tumblr backup

This will download and write all of your tumblr posts, serialized into a simple plain text format, into a directory you list, or your current working directory.

Downloaded the new version with homebrew1 or rubygems, run tumblr authorize to authenticate, and then back up all of your posts in one easy command. You’ll want to give it your tumblr hostname or else you’ll be asked for it repeatedly:

$ TUMBLRHOST=mwunsch.tumblr.com tumblr backup ~/tumblr_backup

Open an issue on GitHub if you encounter any problems.

This script doesn’t download the associated media with your posts, just the posts themselves, in a format suitable for both humans and machines to read.

tumblr@master

Just merged in the v2 branch of my tumblr command line utility and Ruby lib.

The new version is in steady enough state to begin preparing for a release candidate. If writing Ruby scratches your itch, clone the repository. Patches are, as always, welcome.

The new version targets the v2 of the Tumblr API, which is becoming more important as v1 is being phased out.

Check out the new tumblr@master, and get started blogging like a hacker.

Incidentally, this post was published with the new cli.

Expect noisier announcements as the 2.0.0 release gets closer.

[edit]: the cli now supports editing posts: d9ceeb55fefaf036a9073cd050f1287f77b5fdb0

Tumblr has had a history of problematic downtime, but none as excruciating as this most recent debacle.

A couple of notes:

  1. Tumblr is horribly opaque in regards to its system status. Some transparency would be nice. Look to status.github.com for inspiration. It should be noteworthy that while Tumblr went down, Campfire was experiencing trauma as well. But 37signals made sure to set my expectations and cool my nerves with their phenomenal system status page.

  2. I think it is safe to say that a lot of folks and businesses now consider Tumblr a mission critical piece of infrastructure. Note that Twitter’s system status blog was down.

  3. I am not a customer of Tumblr, I am just a user. I’m not paying for my Tumblr account; nobody is. At this point in Tumblr’s operation, I get the sense that the only true customers will be advertisers of some kind in the near future. I’d like to pay for my Tumblr account. At least then Tumblr would have somebody to answer to.

Tumblr is a fantastic blogging platform. So fantastic that it is now my de facto home on the web (nevermind that markwunsch.com; that’s covered in cobwebs). As Tumblr grows and becomes crucial to its users, it can not just measure success in terms of community growth. It has to measure success in nines of availability.

Published, initially, as a gist.

Thimble v0.2.1

Thimble got a little version bump today and a new feature: Auto Refreshing.

Hit the little checkbox and when your theme has been updated, Thimble will refresh the preview.

Implementing this the way I wanted to was a bit of an experiment. Here’s how it works:

How it works

The preview is in an iframe. I did not want to just have the iframe refresh itself every X seconds, potentially interrupting the previewing experience. Rather, I wanted the preview to only refresh when the theme had changed.

Ideally, there would be some kind of magical event loop and when the theme changed, an updated preview would comet itself up to the browser, refreshing the preview. That’s hard, and requires some heavy lifting on the server and the client, and I’m not even sure PHP has a mechanism for “real-time” updates like this. Even solutions like Ruby’s EventMachine and Python’s Twisted are too complex for a tool that prides itself on simple setup.

So Instead, the client JavaScript is in charge of polling to see if the theme has changed. How does it do that? By using the natural cacheing idioms of HTTP:

function ThimblePoll(theme, iframe) {
  $.ajax({
    type: 'HEAD',
    url: 'theme.php?theme='+theme,
    ifModified: true,
    success: function(data, status, xhr) {
      if (status !== "notmodified") {
        iframe.src = iframe.src;
      }
      THIMBLE_POLL = setTimeout(function(){
        ThimblePoll(theme, iframe);        
      }, 5000);
    }
  });
  return THIMBLE_POLL;
}

When ThimblePoll is called, it makes a HEAD request to the theme preview file, which has a Last-Modified HTTP Header. If the response is a 304 Not Modified, that means that the theme has not been updated. If it has been, only then is the preview updated. When you check the auto-refresh box, it’s not going to begin auto-refreshing, it only begins polling in the background until it gets a good response. And since these are HEAD requests, the overhead is minimal.

Some browsers might not like this cacheing approach. If you find you run into stickiness, clear your browser cache. Like anything I make, YMMV.

Tumblr API Wishlist

With the features Twitter announced at Chirp and Facebook’s new “OpenGraph”, there’s a lot of movement happening in the space of Web Services. Here is a list of improvements and/or additions I would like to see to the Tumblr API:

  1. Better Authentication

    It is crazy, CRAZY, that Tumblr has you submit email addresses and passwords unencrypted over the wire as params in the request. There are so many alternative ways of authenticating to a service. I recommend OAuth but anything is better than this.

  2. Versioned API

    See Best practices for API versioning? on Stack Overflow

  3. Better documentation

    See GitHub’s and Twitter’s for inspiration

  4. Better Reads

    If I want to see what posts I like, I use the api/likes method. If I want to read a group of posts by a specific author, I use api/read. If I want to read the posts of people I follow, I use api/dashboard. I can pass api/dashboard a likes parameter to show me what posts I have liked in my dashboard. Why doesn’t api/read allow this same parameter?

  5. More data

    Topherchris put out a call to see what people are doing with the Tumblr API. He showed off Tumblr Circus as an example. How did Topherchris make this with Tumblr’s API? As far as I know, there is no way to access Tumblr’s firehose to query for ALL quote posts. I can only read posts from people I am following (using api/dashboard) or from a specific username. I can not query all posts of type X. Am I missing something?

    What about getting a list of all the usernames that I follow? Or the usernames that follow me? This data should be available via API.

  6. Less aggressive rate limiting

    api/dashboard allows 1 read every 10 seconds. I understand the need for rate limits, but that seems mighty strict. Especially since you MUST authenticate in order to view it. If you need to, you can cut a particular user off.

That’s a start. Authentication is a big problem. I would hop along Facebook’s bandwagon and start investigating OAuth2. The other items on this list are just things that I would like to see, someday.

This article has more about good RESTful API design.

Thimble for Tumblr theme development

Thimble is a PHP tool I put together to make Tumblr theme development a bit easier. It’s a simple application that allows you to test out your theme locally (or on another server) before moving it into Tumblr’s customize page. It’ll protect your fingers from all that tedious copy-pasting.

All you need is a PHP server to get started. Any *AMP will do. Download Thimble, drop it into your public html folder, put your theme in the themes directory, point your browser to the application, and select your theme. If you’ve got MAMP or a locally-running PHP server, you’ll be able to work offline!

Thimble provides a semi-reasonable approximation of Tumblr’s templating system, but it’s by no means foolproof. It’s clunky, and not nearly as intelligent as Tumblr. But it gets a good percentage of the job done. Think of it as a place to test out the rough draft of your theme.

The tumblelog data is parsed out of a YAML file, and it’s pretty easy to create your own.

Right now, Thimble can only reproduce a tumblelog’s index page, similar to Tumblr’s customize page. Support for more page types is planned, as well as a more robust UI for working with the meta tag-driven option blocks.

If you are a Tumblr theme developer or interested in developing Tumblr themes, I hope you find Thimble useful. It’s not a silver bullet, but it should save you a few headaches.

The best way to stay updated on my Open Source work is by following me on Twitter.