![]() We also set the privacy_filter and safe_search to make sure we select photos suitable for broad public consumption. The licence argument selects only those photos that are licenced for re-use. ![]() We must supply the api.key argument, in addition to the lat and lon arguments, let’s refine the call a bit further. Next let’s construct our call to the API - this is in the format of a URL string with a series of arguments. To avoid this error during testing we could put in place some limits for the lat and long to check they’re within the extent of the UK but let’s not overcomplicate, and make it easy for folk to port the code. Similarly if no lat or long are provided let’s throw an error. Matt’s bot is a lightweight bot that picks a random location within an effective bounding-box (by selecting random numbers between the east-west and north-south extents), grabs an image from the Mapbox API, and then constructs and posts a tweet via the įirst the function will check if an API key is provided and if not it’ll look and see if its been set as an environment variable, if no key is available the function will throw an error. Select a random location on the English and Welsh canal network.In this post:īased on the principles of Matt’s londonmapbot, narrowbotR uses Github Actions to do the following: So let me introduce you to narrowbotR … see what I did there, an R based twitter bot that does things narrowboats do. So, inspired by Matt Dray’s recent adventures in location-based Twitter-botting, I wondered whether it might be possible to make a Twitter bot that showcased features of the British canal network. ![]() An anniversary that at the outset of this year I had hoped I might have managed to avoid by taking to the water sometime over the summer. October 2020 marks five years since I last went on a canal boat holiday. I’m sure I’m not the first person, and won’t be the last, to remark that 2020 is a very strange year. Gongoozler a person who enjoys watching boats and activities on canals ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |