@arandommap.bsky.social is a Bluesky bot that runs every hour on a Raspberry Pi and posts random aerial images of the Earth. Inspired by the Earth View extension for Google Chrome. I had a five hour layover and decided to be productive.
RandomMap picks a random continent (including Antarctica) and generates random coordinates inside the chosen continent. It uses the Google Maps API to download satellite, hybrid, and terrain images of the generated coordinates, performs reverse geocoding to get location names, and posts the pictures to Bluesky!
The bot also maintains a journey map showing the last 8 locations visited, displayed as a banner on the profile with numbered, color-coded pins.
Run npm ci to download project dependencies
Create a keys.js file and create objects to hold your Bluesky and Google Developer API keys. Make sure to export them, too:
const google = {
key: '...',
};
const bluesky = {
identifier: '....',
password: '...',
service: 'https://bsky.social',
};
module.exports = {
google,
bluesky
};If the bot has already been running and you want to populate the journey map with past locations, run:
node populate_history.jsThis will fetch your last 8 posts and create the location_history.json file.
Now you're all set. Simply do npm run local