There is a secret API lurking behind those cute little bastards, and the words on this page will tell you about it. Go.
Making a GET request to https://gopherize.me/api/artwork/ (go on, give it a click) will deliver the entire artwork JSON payload for Gopherize.me.
The payload contains two fields;
categories there’s an item for each of the main categories of artwork, like Body, Eyes, Shirts, etc.
Each category has a name, and an array of images that make up the options for that category.
An image also has a name, a URL and a thumbnail URL.
You can see the structure by inspecting the artwork.go file:
Once the user has made their selection of images, you can create a rendering using the Save API, and a list of the IDs of the images that make up the Gopher.
imagesis the pipe-separated list of image IDs that will be combined (in the order specified) to create the final Gopher
Rendering can take a few moments, once it’s finished the endpoint will redirect to a new URL that includes the unique ID of the Gopher:
If you append
/json to the end of this URL, you get the data for the Gopher:
id— the Gopher’s unique identifier
images— array of the images that make up the image (in order)
original_url— the master image
url— A compressed usable image
thumbnail_url— A much smaller thumbnail URL
ctime— When it was created
To see what the community have been up to, you can take a look at the most recent Gophers:
You’ll get back an object that contains a load of little Gophers in the same structure as above.
And finally, a challenge…
Ashley and I will be speaking about Gopherize.me at the UK Go Conference in August (OH NO IT’S AUGUST NOW) and we’d love to include some examples of cool/funny things people have knocked together with this API.
There might even be a little prize for our favourite.