:::: MENU ::::

To move the world, we must move ourselves.

— found on a T-shirt


August 2016 Update

  • I’ve decided to move back to WordPress. I was blogging using the 1999.io CMS developed by Dave Winer, and although I like it just fine, it’s self-hosted on Linode and I haven’t been blogging frequently enough to justify the cost. (I’m already paying an arm and a leg for a VPS that hosts this and other sites like Sasstrology). As part of my clean-up effort, I’ll have to create a “1999” Amazon S3 bucket and start migrating my old blog posts there so that I can shut down my Linode instance.
    • Another reason I’ve moved back to WordPress is that I just want to simplify certain areas of my life. Right now I don’t feel the need to “play” with static blogging or JSON or whatever. I’ve enabled a fairly minimal WordPress theme, and I’ll just blog… and not sweat the backend.
  • Looking for work is slow-going. I attended a 1/2 day webinar yesterday on the job search, and learned that about 70% of jobs are unlisted — which means I absolutely have to network (I shudder just writing the word).
    • I do believe that “knowing people” is beneficial. The last job I got happened because a recruiter called my references, and one of my references reached out to me and said, “Hey, I hear you’re looking for a job. We’re looking for a freelancer.” 15 months later I was offered a full-time position that lasted close to four years. I never interviewed for it.
  • I recently signed up for Car2G0, which is a ride-sharing service which lets users open a smart car with an app, drive, and later park it elsewhere in the city (in the home area). It’s 41 cents a minute, and I’ve found a drive costs me about 1/2 the price of an Uber, so I’m happy that there are more options for city dwellers that don’t own a vehicle.
  • I’ve managed to keep off the 15 pounds I lost, but I’ve been stuck at my current weight for a few months. The last 5-10 pounds really are the hardest. I’ve been making it a goal to walk 10,000 steps a day, and right now I am preparing a whole-grain breakfast. I hope it’s good, because it’s a whole lot more work than pouring milk over Heritage Flakes.

Blogging Difficulties

It seems that Postach.io — the Evernote blogging platform — is having technical difficulties. Right now the server is down. Earlier today, I couldn’t shorten posts on the home page. I signed on to look at my settings, and it appears that there is no longer a free tier. They have done a poor job of communicating changes.

So for now I’m going back to WordPress.



Take a Photo, Get a Markdown Image Link with Launch Center Pro, Clean Links, and TextTool

Before I wrote my previous post, I put out a call on Twitter for an iOS app that cleans short links and that also supports x-callback-url. After all the work of adapting a Pythonista script to resolve a short Dropbox link, I finally received a response from @malanowski: Clean Links. Although I cannot find any x-callback-url documentation on the web, there is documentation in the app itself.

I’ve now written a Launch Center Pro action that does the exact same thing as described in my previous post but without the hassle of creating a script in Pythonista. All you have to do is tap on this link while on your iPhone and install the action in Launch Center Pro.

Take a photo, tap on the LCP action, and your shared Dropbox image is available for publication in Markdown format in TextTool. From there you can tap on Open In... to send to your favorite text editor.

The Geeky Details

This action uses three x=success parameters, each of which is URL-encoded. The final TextTool transform is tripe-URL-encoded.

launchpro-dropbox://addlastphoto?path=&name=&quality=&getlink=1&x-success=clean-links%3A%2F%2Fx-callback-url%2Fclean%3Furl%3D%5Bclipboard%5D%26retParam%3Dtext%26x-success%3Dtexttool%253A%252F%252Fx-callback-url%252Ftransform%253Fmethod%253Dreplace%2526find%253Dwww%2526replace%253Ddl%2526x-success%253Dtexttool%25253A%25252F%25252Fx-callback-url%25252Ftransform%25253Ftext%25253D%25255B%25255Boutput%25255D%25255D%252526method%25253Daffix%252526prefix%25253D!%2525255B%2525255D%25252528%252526suffix%25253D%25252529

First, LCP adds the last-taken photo to Dropbox — by default to /Apps/Launch Center Pro/photos and makes the URL shareable. It is offered in a short URL (db.tt). This URL is sent to Clean Links, and the resolved URL is sent to TextTool. TextTool uses the replace method to swap www with dl. It then takes that output and adds the Markdown elements (![](http://dl.dropbox.com/___.jpg)).

Here are each of the x-success parameters URL-decoded.

This is encoded once:

clean-links://x-callback-url/clean?url=[clipboard]&retParam=text&x-success=texttool%3A%2F%2Fx-callback-url%2Ftransform%3Fmethod%3Dreplace%26find%3Dwww%26replace%3Ddl%26x-success%3Dtexttool%253A%252F%252Fx-callback-url%252Ftransform%253Ftext%253D%255B%255Boutput%255D%255D%2526method%253Daffix%2526prefix%253D!%25255B%25255D%252528%2526suffix%253D%252529

This is encoded twice:

texttool://x-callback-url/transform?method=replace&find=www&replace=dl&x-success=texttool%3A%2F%2Fx-callback-url%2Ftransform%3Ftext%3D%5B%5Boutput%5D%5D%26method%3Daffix%26prefix%3D!%255B%255D%2528%26suffix%3D%2529

This is encoded three times:

texttool://x-callback-url/transform?text=[[output]]&method=affix&prefix=!%5B%5D%28&suffix=%29

And actually the Markdown elements are encoded in the above action:

prefix=![](&suffix=)

Take a Photo, Get a Markdown Link with Launch Center Pro, Pythonista, and TextTool

This routines allows you to do the following:

  • Take a photo with your iPhone.
  • Tap on the “Upload to Markdown” Launch Center Pro action.
  • Get a Markdown image link (made shareable in Dropbox) in TextTool.

What It Does Step-by-Step

  • Launch Center Pro uses its new Photo Attachment action to upload the last-taken photo to Dropbox. This link, which looks like db.tt/___.jpg, is a shortened URL of the shareable link on Dropbox.
  • The Launch Center Pro action (if you’re on your iPhone, tap on this link to install it) then sends the clipboard contents to Pythonista.
  • The Pythonista CleanURL script (get the code here and then create a new script in the app and call it CleanURL) resolves the shortened URL and sends it to TextTool.
  • TextTool replaces the www in https://www.dropbox.com with dl. In this URL format, the actual image (instead of a download page for the image) would load in the browser. (Example: download page resolved from short Dropbox URL; the image itself which will redirect to dl.dropboxusercontent.com in the browser.)
  • TextTool then takes this transform and uses the affix method to add Markdown elements to the URL to make it an image link.
  • You can then use the Open In… action to send it to your favorite text editor and then publish it.

The Geeky Details

The Launch Center Pro action is as follows:

launchpro-dropbox://addlastphoto?path=&name=&quality=&getlink=1&x-success=pythonista%3A%2F%2FCleanURL%3Faction%3Drun%26argv%3D%5Bclipboard%5D

By default it uploads the last-taken photo to the /Apps/Launch Center Pro/photos folder in Dropbox. It then sends the link to Pythonista. Here is the x-success parameter URL-decoded:

pythonista://CleanURL?action=run&argv=[clipboard]

(The Python script and this URL action are adapted from Federico Viticci at MacStories.)

Pythonista resolves the short URL and sends the results to TextTool. Here is the complete URL scheme at the end of the script:

texttool://x-callback-url/transform?text=' + final + '&method=replace&find=www&replace=dl&x-success=texttool%3A%2F%2Fx-callback-url%2Ftransform%3Ftext%3D%5B%5Boutput%5D%5D%26method%3Daffix%26prefix%3D!%255B%255D%2528%26suffix%3D%2529

In the first TextTool transformation, www is replaced with dl. The x-success parameter calls TextTool again to take its output and transform the new URL into a Markdown image link. (This part was difficult and I want to thank Craig at Black Fog Games for his help on Twitter.) Here is the x-success parameter URL-decoded:

texttool://x-callback-url/transform?text=[[output]]&method=affix&prefix=!%5B%5D%28&suffix=%29

And here is the last part URL-decoded again:

prefix=![](&suffix=)

The tricky part is that the Markdown elements need to be URL-encoded for the affix action and then URL-encoded again when the entire URL action is added to the x-success parameter.

The CleanURL Pythonista Script


Create Markdown Links to Open Profiles in Tweetbot with This Drafts URL Action

This Drafts URL action does the following:

  • Enter a Twitter handle in Drafts.
  • Choose the tweetbot-md-byword action.
  • If you have a markdown file called twitter in the local root directory in Byword, this action will append to that file a markdown link that — when tapped in preview — will open that user’s profile in Tweetbot.

It will look like this (if your drafts is kishner):

* [kishner](tweetbot://YOURUSERNAME/user_profile/kishner)

(Here is the Tweetbot URL scheme.)

To import into Drafts while on your iOS device, tap on this link. You will then need to go into the URL action and change YOURUSERNAME to your Twitter handle.

The Geeky Details

This is what the URL action looks like:

byword://x-callback-url/append?location=local&name=twitter.md&text=%0A*%20%5B[[draft]]%5D(tweetbot%3A%2F%2FYOURUSERNAME%2Fuser_profile%2F[[draft]])

The text that gets appended to the Byword file — when URL-decoded — looks like this:

* [[[draft]]](tweetbot://kishner/user_profile/[[draft]])

It starts with a line break and then an asterix followed by a space, so that the markdown links show as an unordered list.

You can customize this to your liking. The Byword location can also be dropbox or icloud. And you can specify the filename and even the path. For all those details, visit the Byword x-callback-url API. You can also use another app entirely provided you know the URL scheme.


Safely Open a “Go” Link on Your iPhone with Launch Center Pro, TextTool, and Drafts

If you ever surf the web on your iOS device and encounter a link that contains something like go.php?url=, you’re encountering a redirect. However, because you cannot (conveniently) read the php script, you cannot tell if the browser will actually send you to the link after the = sign. Some less scrupulous webmasters send you somewhere else entirely.

The following solution requires three different iOS apps, but the end result is that you just copy the entire URL to your clipboard, tap on the Split = action in Launch Center Pro, and Safari will open the URL after the = sign. (There is also a solution for iCab Mobile and Google Chrome at the end of this article.)

First, on your iOS device tap on this link and choose where in Launch Center Pro you will install the action. The URL scheme is as follows:

texttool://x-callback-url/transform?text=[clipboard]&method=split&delimiter=%3D&x-success=drafts%3A%2F%2Fx-callback-url%2Fcreate%3Ftext%3D%5B%5Boutput%5D%5D%26action%3Dline2

What It Does

  • It sends the clipboard contents to TextTool, which splits the contents at the = sign and puts each section on its own line. With a go link, the URL you want to open will be the second line.
  • After the successful transformation, the results are sent to Drafts.
  • Then the line2 URL action in Drafts is performed. This action sends the 2nd line of the draft to Launch Center Pro, and LCP simply opens the URL in Safari.

For example, if you copy http://url1.com/go.php?url=http://url2.com to the clipboard, http//url2.com will open in Safari.

Install the Drafts Action

While on your iOS device, tap on this link to install the line2 URL action in Drafts. It’s simply as follows:

launchpro://?url=[[line|2]]

For Other Browsers

Let’s say you’re browsing in iCab Mobile. The workaround is slightly more complicated. The LCP action is exactly the same but we’re replacing the line2 URL action in Drafts. Tap on this link to install the alternate URL action, which is as follows:

texttool://x-callback-url/transform?text=[[line|2]]&method=replace&find=http&replace=web&x-success={{launchpro://?url=[[output]]}}

This sends line2 of the Draft to TextTool, which replaces http with web (replace web with googlechrome if you want the URL to open there). Upon success, TextTool sends the output to LCP, and LCP opens that URL.


Use Drafts and TextTool to Turn a List Into an OPML File

TextTool, a new iOS app that transforms text in various ways, has just been released in the App Store. MacStories has an informative article on it. Federico wrote a Drafts URL Action to turn a list in Drafts into a Markdown-formatted list using the affix method in TextTool, and then send that text back to Drafts using x-callback-url.

Frequent readers know I am OPML-obsessed. (OPML is a structured data format for outliner software.) In May, I wrote a complicated set of Drafts actions to convert a list in Drafts into an OPML file. With TextTool, this solution become a whole less complicated. TextTool allows me to to affix a prefix of <outline text=" and a suffix of " /> to every line imported from Drafts, and then send that text back to Drafts. I then can use a Dropbox action to put the draft text into a template surrounded by the OPML header and footer to create a valid file (which can then be imported into an app like Fargo).

Import the Drafts Actions

If you’re reading this on your iOS device, tap on this link to import the texttool-opml URL Action into Drafts. (You must of course have both Drafts and TextTool installed on your device.)

The URL Action itself looks like this:

texttool://x-callback-url/transform?text=[[draft]]&method=affix&prefix=%3Coutline%20text%3D%22&suffix=%22%20%2F%3E&scope=lines&x-success={{drafts://x-callback-url/create?text=[[output]]&action=texttool-opml-dropbox}}

The action at the end of the x-success parameter tells Drafts to then perform the textool-opml-dropbox Dropbox action. Tap on this link to import it.

It essentially wraps the [[draft]] with the text required to make it a valid OPML file.

Type of Action: dropbox
Name: texttool-opml-dropbox
Path: /Apps/Fargo/
Filenametype: Predefined
Filename: [[date]]
Extension: opml
Writetype: Created
Template:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
    <head>
        <title>[[date]]</title>
        </head>
    <body>
        [[draft]]
        </body>
    </opml>

How It Works from Beginning to End

If I enter the following into Drafts and then tap on texttool-opml

Line 1
Line 2
Line 3

it will send an OPML file titled 2013-11-21.opml to the /Apps/Fargo folder in Dropbox:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
    <head>
        <title>2013-11-21</title>
        </head>
    <body>
         <outline text="Line 1" />
<outline text="Line 2" />
<outline text="Line 3" />
        </body>
    </opml>

I can then open this file from within the Fargo app.

You can customize this in many ways. For example, if you like Carbonfin Outliner, use the Dropbox action to send it to the /Outliner folder and then sync the iOS app to import the file.


How to Download Music from Bandcamp to Your iPhone

I recently signed up at Bandcamp to download this great cover of Daft Punk’s “Get Lucky” by Beats Antique, and when I clicked on the link in my iOS mail app I received a message that I could not download the track to my phone, I had to do it via iTunes.

Fortunately, there’s a hack for that.

Download the iCab Mobile web browser to your phone. In the Tools, under Browser ID, choose Safari 6 (Mac). This tells the server that you’re on a desktop, not your iPhone.

Copy the download link and paste it into the iCab address bar, and choose to download the MP3. You’ll see the download progress at the icon that looks like a down-facing arrow surrounded by a circle. When the download is done, tap on that icon and you’ll see all your iCab downloads. From there, you can open the MP3 in another app (“Open in an External App…”). You can save it Goodreader or Dropbox, for example.


Pages:1234567...20