Workflow

~2 m

Today’s exercise is in 2 parts with stretch goals

Workflow exercise

  1. Choose a buddy - this is much better done in groups of 2 or 3
  2. Choose an engine (links below) that’s not in use and log into it
  3. Work through the intro tab
  4. Get the API key for OpenWeatherMap from Bruce (or sign up for your own account)
  5. Work with your body to craft a weather query for your town
    1. You can start with a clean tab if you’re confident
    2. You can also use the incomplete weather tab if you need a bit more help
    3. drop a pin on google maps to get the lat/long of a location
    4. Use that data with the weather query to get the weather data
  6. Get the weather information back as a json - attach a green debug node to see the results
  7. Use data from the JSON to find an appropriate image by searching google / unsplash / bing etc.
    1. you might have to turn some json fields into a sentence e.g.

      1
      2
      3
      4
      5
      6
      
      temp = msg.payload.current.temp - 273 // convert kelvin to celsius
      cloudy = msg.payload.current.weather.description
      cloudy = cloudy.replace(" ", "+") // replace spaces with plus for google
      zone = msg.payload.timezone
      zone = zone.replace("/", "+")  // replace slash with +
      query_text = `q+weather+for+temperature ${temp}C+${cloudy}+${zone}`
      

Stretch goal

  1. Enhance image search by using a with creative commons filter
  2. Try another place in the world using latlong.net
  3. Extend your workflow to automatically find lat long with a service like geocode.maps.co
  4. Ask an AI to describe your image by sending it to an AI engine and see if you’ve managed to describe the weather

Test the workflow

Log into one of the shared links below. If you get a 404 error, it’s because the servers are only set up during courses