Source for the former Mastodon bot @[email protected]—and former Twitter bot @londonmapbot—for posting random satellite images of London. Built by Matt Dray.
The repo contains a GitHub Action that executes R code on schedule to:
- Choose a random spot in a bounding box that encloses Greater London.
- Query the Mapbox API for a satellite image of that location.
- Generate an OpenStreetMap URL for that location.
- Post the image and URL to Mastodon using {rtoot}.
Thank you to MapBox; OpenStreetMap contributors; and David and Chung-hong.
The bot was built originally for Twitter as @londonmapbot using the {rtweet} package. Thank you Michael, Lluís and Hadley. Posts to Twitter stopped in May 2023 due to changes in the API terms of service. You can see an older version of the repo from before the Twitter-related code was removed.
The bot was ported to the botsin.space instance of Mastodon thereafter, but was stopped from updating in December 2024 after the announcement that the instance would be shutting down. Thank you Colin.
To run this code locally, you'll first need to create and complete a .Renviron
file in the project root using the .Renviron.example
file as a template. If you enable the GitHub Action to run the R script, you'll need to add these environmental variables to the GitHub Secrets of your repo.
For more information about the bot's development, see:
- my talk at LondonR in Feb 2022 (see the blog, slides, video)
- my original introductory blog post
- my blog post about porting the bot to Mastodon, following Matt Kerlogue's advice