embedding flickr

It's all D's fault, he stole my camera so I had to buy a new one. Now I want to resurrect the little flickr gallery that used to be on https://joe.milbourn.org.uk, but better.

Here's the idea, show a few thumbnails, but randomly sampled from all of my pictures on flickr. How can we do that?

Well, flickr publish a json feed https://www.flickr.com/services/feeds/ with some parameters https://www.flickr.com/services/feeds/docs/photos_public/

$ curl https://www.flickr.com/services/feeds/photos_public.gne\?format\="json"\&nojsoncallback=1\&id\=69124908@N00 | jq
{
  "title": "Uploads from Joe Milbourn",
  "link": "https://www.flickr.com/photos/joemilbourn/",
  "description": "",
  "modified": "2020-05-20T17:40:43Z",
  "generator": "https://www.flickr.com",
  "items": [
    {
      "title": "orwell orchard",
      "link": "https://www.flickr.com/photos/joemilbourn/49916835321/",
      "media": {
        "m": "https://live.staticflickr.com/65535/49916835321_73279ba87b_m.jpg"
      },
      "date_taken": "2020-05-20T10:29:19-08:00",
      "description": " <p><a href=\"https://www.flickr.com/people/joemilbourn/\">Joe Milbourn</a> posted a photo:</p> <p><a href=\"https://www.flickr.com/photos/joemilbourn/49916835321/\" title=\"orwell orchard\"><img src=\"https://live.staticflickr.com/65535/49916835321_73279ba87b_m.jpg\" width=\"240\" height=\"180\" alt=\"orwell orchard\" /></a></p> ",
      "published": "2020-05-20T17:40:43Z",
      "author": "nobody@flickr.com (\"Joe Milbourn\")",
      "author_id": "69124908@N00",
      "tags": ""
    },
    ...
    ]
}

No obvious way to get more than the twenty most recent items from that, but that's probably good enough.

Bit of javascript to choose three at random, some css to make it look OK, and we're done.