/color-of-montreal

A bot that tweets the color of the sky in Montreal.

Primary LanguageJavaScript

Color of Berlin Montréal

A Twitter bot that tweets the color of the sky in Berlin that was forked to tweet the color of the sky in Montréal.

Montreal's specificity

  • Translated colors to French (couleurs.js)
  • Added a connection to Web3 to bring these colours onchain on Optimism

This bot fetches the latest image of the sky in Montréal, crops and places it on an HTML5 Canvas, picks the color and matches it against a color list, fills a new Canvas with the color that was matched, then tweets the color name, image, and HEX value.

Prerequisites

Initial set-up and installation

  • Clone the project: git clone git@github.com:laurendorman/color-of-berlin.git
  • Change to the project directory: cd color-of-berlin
  • Install the project dependencies: npm install

Create .env file

In the project root, create an .env file or make a copy of the .env.example file, containing the following environment variables with the required values:

TWITTER_API_CONSUMER_KEY=
TWITTER_API_CONSUMER_SECRET=
TWITTER_API_TOKEN=
TWITTER_API_TOKEN_SECRET=
SOURCE_IMAGE=
LOCATION=

Send a tweet

  • In the project directory, run node index.js from the command line to send a tweet.

  • Currently tweeting the color of the sky in Montreal with the following account @vncntxyz

Credits and Inspiration

Currently using images from Montreal's Traffic camera infrastructure.

Thanks to Lauren Dorman's Color of Berlin

Original repository used Meteorology/sky photos sourced from Berlin's official tourism and congress organization webcams at visitBerlin.

Forked color list provided by @gekidoslair.