narrowbotR

A Twitter and Mastodon bot that cruises the UK canal network.

A tweet by the narrowbotr

About this project

Project date: 2020-Present

The narrowbotR1 is a simple bot that posts on Mastodon locations from the Canal & River Trust (CRT) network in England and Wales. The bot also posted to Twitter from its inception in 2020 until April 2023 when posting to Twitter was suspended due to changes in the Twitter API’s Terms of Service.

The narrowbotR is inspired by the Londonmapbot, created by Matt Dray, which regularly posts to twitter a randomly selected location within the general area of Greater London. It posts the latitude and longitude, a link the location on Open Street Map and an aerial photo of the location provided by Mapbox. It has inspired a number of other similar twitter bots, the “mapbotverse”.

Having seen Matt’s efforts I thought up the narrowbotR during the Covid-19 pandemic when lockdowns and other restrictions meant I was unable to go on holiday and was particularly missing canal boat holidays. Upon discovering the CRT publish some of their geospatial information as open data, I realised there was a possibility to use the Londonmapbot’s approach to tweet canal related locations.

As an important resource for leisure, heritage and environmental protection many people find canals, their features, use and surroundings worthy of photographing. So in addition to using the CRT data as the location source, the narrowbotR also adapts the Londonmapbot’s approach to make a call to the Flickr API to search for photos taken near the location, falling back to a Mapbox aerial image if no photo is available. This functionality makes use of the ability in the Flickr API to search by location, and then uses an algorithm to score the photos and select a photo for inclusion in the post.

Originally developed for Twitter, the narrowbotR now also posts to Mastodon.

You can read more about the original development of the narrowbotR and the migration to mastodon on my blog.


  1. A play on the word “narrowboater” as it is a bot that posts about narrowboats and works by using R. ↩︎