Using Pocket

I’ve been using Pocket (formerly Readitlater) for a few years now, and I find it indispensable. It’s simple and fits easily into the way I handle links.

Bookmarking and baggage

Putting bookmarks into a browser bookmarking hierarchy is the digital equivalent of hoarding. I never go back to the bookmarks, so they just become a mental burden. Every few years, I move to a different browser and either lose all the bookmarks, or copy them over, never to be looked at again. When I started my Pocket system, I imported 1600 links into pocket, many of which were not active anymore, and most of which I could not even remember having added.

So what about other online bookmarking services? While they are more portable, they suffer from the same basic problem: I never go back, they are cumbersome to organise and they require me to categorise.

Enter Pocket

Pocket has a few advantages compared to other systems:

  • It’s designed around a single stream of information, organised by the date you place the link into Pocket.
  • It has browser plugins and Android actions.
  • It has offline readers for Android and iOS.
  • It has an API, so I can get access to my queue from scripts.

Getting stuff in

I have 2 ways to get info into pocket: Sharing from my phone and saving from the browser.

On my phone I usually save items directly from my twitter feed. Pocket places a sharing option on the Android context menu, so I can save tweets with links directly from my timeline. The only problem I have with this is the case where a tweet has 2 links. Pocket then only saves the first one.

In my browsers on my computer I have the Pocket addons, so I just hit the button to save a page for later viewing. Firefox is really nice here: The tab closes automatically when I save a page to Pocket, so it’s a quick one-click operation.

The thing to note here is that I don’t do any filtering or categorising when putting content into the list. If I might want to look at something later, it goes into the list. Takes less than a second.

Getting stuff out

If I only used Pocket as a general reading list, it would have been OK, but I would sit with the same problem: Too many links, neglected and forgotten. Instead, I have a system that automatically recycles the links, courtesy of some scripts I set up:

Every day, some time after 5pm, my browser automatically opens between 10 and 20 links from my Pocket queue. These are the oldest links in the queue. I then have some choices:

If I don’t want to spend time on these links, I just close the tabs quickly. This keeps the links and they will re-open the next day.

If I have time, I read through them. The plugin automatically removes them from Pocket if I view a tab for more than 5 seconds.

If I want to keep the link around for a while, I just push it back into Pocket. This puts it back into the queue as a new link, so I’ll only see it when it comes round again.

The end result

Using this system, I cycle through the full queue roughly every two to three weeks. It blocks out time for reading them, and is not distracting at any other time. I can confidently just push things into Pocket and forget about them, knowing that I’ll get around to them soon.

Since the Pocket list is searchable, I can refer back to items on it if I recall something that piqued my interest recently.

An interesting side effect is the serendipity of random connections: Every so often I see a link that triggers some insight, just at the right time. It’s a bit like putting your music on shuffle and listening to a song that randomly captures the exact mood.

A trick to autonumber in ZPT

I had an interesting issue a few months ago. I was doing some work where I needed to create a pdf from a template. This was a numbered legal document with optional clauses. The problem is this:

How do you make some clauses conditional, but then autonumber the rest?

Normally, you would hardcode clause numbers into the paragraphs, but if you did that, the paragraphs following on the optional ones would be incorrectly numbered.

My coworker came up with the idea of using python’s ‘next’ functionality to just increment an iterator. I was skeptical, since I did not think of a page template as an environment where python objects would be able to keep state outside of tal statements. I was wrong.

The final solution is remarkably simple. In this case, the numbers for the first 20 clauses were hardcoded. We start off with a tal statement to get an iterator:

<body tal:define=”clause_numbers python:iter(range(21,28));”>

This allows you to number up to clause 27.

In each clause, just do the following:

<span tal:content=”python:clause_numbers.next();”></span>

and it works!

In retrospect, this does make sense, since the template is backed by persistent code objects, so an iterator should do the job.