Shortcode cooking.

Tuesday, May 5th, 2020

I spent a chunk of today learning more about JSON and Javascript and to a lesser extent Python. The latter two are (you may well know) the scripting languages that enable easy communications with web servers and their data, often using commands collectively known as APIs, or Application Programming Interface.

Basically, your script or code tells the server give me every Instagram photo or Twitter tweet I have posted from February to present, and it coughs up a big ol chunk of text for each and every picture that gives you in brackets and types with colons, how many likes this picture has and here’s its URL and here’s when to the very second it was taken or posted. Every picture on Instagram, for example, has an ID number; it also has a shortcode that is absolutely unique to that picture and is part of the URL when you use a web browser to call it up. (It happens behind the scenes on the app on your phone, but same deal.) Here’s one of mine: qA4rXrTZcC. It corresponds to a picture of some railroad container boxes I shot in Manchester, Georgia on July 3, 2014.

Yes, you can do useful things with this! And it’s helpful for me to keep clear in my head the difference among javascript objects, arrays, and lists. And their Python counterparts.

It used to be that service providers were very open about allowing you to access this useful information programatically. These days, it involves the most difficult steps for me: authentication and asking for data it in chunks small enough not to annoy the server.

So getting this:

qA4rXrTZcC Thu Jul 03 2014 23:20:50 GMT-0400
Lubalin graph bold has always been one if my favorites. #csx #typography 10 likes
p9y0iNTZQf Wed Jul 02 2014 18:31:56 GMT-0400
Home of sunny cows. #portland 1 like
p9yqcXzZQS Wed Jul 02 2014 18:30:33 GMT-0400
Gon in 60 seconds. #gondola #ttx #trains 4 likes
p9yc2szZf6 Wed Jul 02 2014 18:28:42 GMT-0400
Home of potatoes. #sofa #couch #divan #sprawl 1 like
p4n6cjTZak Mon Jun 30 2014 18:20:25 GMT-0400
Sunset of the #caboose. #penncentral 3 likes
p0Fh3vzZSf Sun Jun 29 2014 00:03:00 GMT-0400
Both Great and Northern. #caboose #trains 2 likes
p0FWsnTZSP Sun Jun 29 2014 00:01:29 GMT-0400
The only backpacker in #seattle. 3 likes

is a (for me) useful way of looking at:

Also killed some mosquitos in the back yard.