The elusive Pinterest App Link handler

App Links seem like a perdy good idea: trying to bring back a bit of the web to walled garden-ed applications. Of course, the issue is it's up to the individual app developers to support them. And it seems that the big social sites are quite fond of not making things more open. Also, they like to break stuff that was working before.

The tl;dr is the old Pinterest protocol handler for opening the app was pinit12, now it's pinterestsdk.v1. Previously, to create a pin you'd use pinit12://pin/create/bookmarklet/ now you use pinterestsdk.v1://pinit/. I haven't tested it out completely, because I got really bored of the limitless hell that is "sharing to social networks" - but it opens up the app and looks like it works (I added the info.plist settings from the SDK docs - though they probably shouldn't be necessary).

I found the handler thanks to an error message that popped-up in a stack trace. It eventually lead me to PDKPin.m which contained the following lumps of gold:

static NSString * const kPDKPinterestAppPinItURLString = @"pinterestsdk.v1://pinit/";
NSURL *pinitURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", kPDKPinterestAppPinItURLString, [params _PDK_queryStringValue]]];
    if ([[UIApplication sharedApplication] canOpenURL:pinitURL]) {
        [[UIApplication sharedApplication] openURL:pinitURL];
    } else {
        //open web pinit url
        NSDictionary *webParams = @{@"url": [sourceURL absoluteString],
                                    @"media": [imageURL absoluteString],
                                    @"description": pinDescription};
        NSURL *pinitWebURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", kPDKPinterestWebPinItURLString, [webParams _PDK_queryStringValue]]];
        [[UIApplication sharedApplication] openURL:pinitWebURL];

Hopefully this is useful to fellow tired and weary social-sharing-integration souls wandering the wastelands of terrible SDKs and out-of-date documentation (including, most likely, this blog post). God speed.

mrspeaker's head in a monitorYou find yourself at the entrance to the Hompage of Mr Speaker. In a darkened corner sits a trunk containing HTML5 games and some JavaScript tidbits. In a dark corner you spy a Twitter account. Exits are North, East, and .

?> _

CyberVision Lite

Indie Game: the movie was filled with inspirational things. The least of which was probably Phil Fish's self-air-quoted childhood "software" creation: CyberVision. When I watched this a few years ago I thought it was too good to be lost to the ages, so I recreated it. Choose between 150, 300, 600, and 1200 flash. There might more more flash's available in the future as downloadable content.

Stick your face in it and stare at it. For a long time.

Code-golfing the BASICs

Moments of genius: they strike me once ever 9 years, apparently. The last one happened when I realised how to correct distribute beers - this one happened when I figured out how to shave 4 bytes off the perennial BASIC classic...

20 GOTO 10

Applying my Mr Speaker's Stroke-of-genius 2015:

20 RUN

I deserve a correctly-distributed beer for that one.

British Pathé random video viewer

British Pathé recently released 90,000 videos on to YouTube (though I could only find 82058 of them) - I wanted to make some kind of mashup art with it, but was not creative enough to think of anything interesting. So, instead I present: Random video player! Randomly (and pretty-much-endlessly) play through the collection, marveling at the wonders of the not-so distant past.

If you want to play with the code, check out the repo... it's an ES6 React app, that uses RxJS to create and consume a stream of video ids based on button clicks & pop state events.

Functions as RxJS Subjects

Here's a nifty trick if you're using RxJS, and want to subscribe to plain ol' function invocation. This is especially useful if you want to use React, and don't want to bind with Rx.Observable.fromEvent with standard DOM event listeners.

import Rx from 'rx';

const RxFuncSubject = () => {
  const subject = Object.assign(
    (...args) => subject.onNext(...args),

  return subject;

export default RxFuncSubject;

We create a regular function that we extend with both Rx.Observable and Rx.Subject (you need to mix in Rx.Observable as this is extended by Rx.Subject internally).

The function passes its arguments along to the internal onNext function: so it can be called as a regular function but still act like a Subject:

const clicker = RxFuncSubject();
clicker.subscribe(() => console.log('clicked!'));
clicker(); // clicked!

Now it can be used in a normal React component, wherever a function call would be expected!

<MyComponent onClick={clicker} />

Five short years

On Friday, October 22, 2010 I conducted a scientific experiment: if one URL shortener can make a URL shorter, then fifteen URL shorteners can make it reaaaally short. The results were quite as you'd expect: the resulting link was longer than source, and browsers would go into convolutions trying to resolve the chain of shortened shorteners.

2010 was a big year for people who thought it would be a good idea to make smaller URLs. All it took was a rudimentary knowledge of a hash map and an hour of coding and suddenly you had a viable startup on your hands. There are a lot of URLs out there, so the thinking went, and people need a place to make them shorter. Phase 1: Shorten URLs...

So now it's 5 years later, and I thought it would be interesting to see what become of that unraveling chain of hopes and dreams. Here they are, in reverese order of resolve-y-ness:

  1. ALIVE. Correctly resolves to
  2. ALIVE. Correctly resolves to
  3. ALIVE. Correctly resolves to
  4. Service: ? Link: DEAD. I'm not even sure how this one ever worked!
  5. DEAD. Domain squatter-ed
  6. ALIVE. "The internet's first and only sex-positive url shortener".
  7. ALIVE "Free short URLS since 1999"
  8. Service: ALIVE Link: DEAD. This looks reasonable though: "Link Disabled because of T&C violation".
  9. DEAD. Domain squatter-ed
  10. DEAD. "Wurl Redirection Service is permanently closed."
  11. DEAD. Domain squatter-ed
  12. ALIVE. "Snippety snip snip". Whatever that means.
  13. DEAD. Redirects link to a 404.
  14. DEAD. Domain squatter-ed. Also, my office router warns "Gateway BOTNET Filter Alert".
  15. ALIVE. Resolves correctly, but the service has a lovely broken image gif as a logo now.

I was quite impressed to discover that 8 out 15 still resolve the links correctly (counting the T&C violation). That means that only around half of world's shortened URLs now 404: much better than I thought! I'll revisit this post in 2020, so be sure to come back then to see how it goes - just keeping this handy 8x shortened link lying around. I've run it through all the remaining contenders, so I see no reason it won't resolve in another 5 years.

Explostyx: explody 3D french fries

Some more crazy 3D action in the form of Explostyx: explody 3D french fries thing. It's what happens when you make one simple thing and then just repeat it a whole stack of times. Like all good pop art.

It's using Three.js, and 100-odd lines of ES2015 - so it's a pretty simple example if you want to delve into either.


Wanna do new JavaScript + React?

Here's the "easiest" way to get started with the latest version of JavaScript (so much new stuff in es2105!) and the most popular kid (for this week, at least) in the JS framework playground: React.

This approach uses the wonderful new JSPM package manager... so if you're not willing to place your bet on this particular horse, then head over to WebPack land to see if they have a similar guide. Also, if you want to see the final product - here's my "ES2015+React boilerplate".

  1. Create a new project with jspm install (and install JSPM if you haven't).

  2. Hit enter over all the defaults, except for Transpiler: traceur/babel?. Change this to Babel. It's more cool this week, and supports JSX.

  3. But it doesn't support JSX by default. To allow it, we need to tweak the babelOptions in the config.js file. Add the option "blacklist": [] to remove react from the blacklist.

  4. Next we need a simple index.html page. Inside the body tag:

      <div id="app"></div>
      <script src="jspm_packages/system.js"></script>
      <script src="config.js"></script>

    This loads the "System" module loader polyfill so we can load modules. The config file specifies a bunch of modules to load (such as React!). Finally, we do our own System.import and call our own file at /src/main.js.

  5. Add a script at /src/main.js. Make it look like this:

    import React from 'react';
    export default React.render(
      <div>Hello World </div>,
  6. Serve it up. Use the simple web server of your choice (I like http-server) to serve the page, and test all is well.

Phew, quite a lot still - but worth it to get all the magical goodness. Plus it's all in the boilerplate repo if you don't want to do these steps every new project.

Alien vs Joy Division

Above is from "Alien" released in May 1979. Below is from Joy Division’s "Unknown Pleasures", April 1979.

Screenshot from Aliens, contrasted with the classic Joy Division album cover