Coder Social home page Coder Social logo

seratch / slack-weather-radar-map Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 25.83 MB

Japan Weather Radar Map (雨雲レーダー) on Slack ⛈️

Home Page: https://qiita.com/seratch/items/7ebc483a486cfabe306a

License: MIT License

TypeScript 98.15% Dockerfile 1.85%
slack slackbot bolt yahoo-weather-api typescript heroku

slack-weather-radar-map's Introduction

Japan Weather Radar Map (雨雲レーダー) on Slack

This is a working example app which displays Japan weather radar maps on Slack. This application is built with Bolt⚡️ and Yahoo! JAPAN Static Map API (雨雲レーダー表示).

Deploy

/amesh {prefecture name}

This command posts an animated GIF showing the forecasting weather map.

/amesh {prefecture name} now

This command instantly posts the present moment image.

/amesh {prefecture name} today

This command posts the transition of weather map in the last 24 hours.

Map Mode

https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/static.html#request-param

The defualt map mode is map. If you'd like to customize the appearance, set YAHOO_JAPAN_API_MAP_MODE env variable with either of the following values.

  • map - 通常の地図
  • photo - 航空写真
  • map-b1 - 地下街
  • hd - ハイビジョン地図
  • hybrid - ハイブリッド地図
  • blankmap - 白地図
  • osm - Open Street Map

Here is the output with hybrid mode.

How to run this app

Create a Slack App

https://api.slack.com/apps

  • Features > OAuth & Permissions:
    • Scopes:
      • "bot"
      • "commands"
      • "files:write:user"
    • Click "Save Changes"
  • Features > Slash Commands:
    • Click "Create New Command"
      • Command
        • Set /amesh
      • Request URL
        • Set https://{your app name}.herokuapp.com/slack/events
      • Short Description
        • Set something helpful for users
      • Click "Save"
  • Features > Bot User:
    • Click "Add a Bot User"
    • Click "Add Bot User"
  • Settings > Install App:
    • Complete "Install App"

Run the app on your laptop

# prep
nvm use 10.13.0 # Bolt runs on Node 10.13+
cp -p _env .env
vi .env
source .env
npm i

# run the app
npm run local

# on another terminal window
ngrok http 3000

Deploy to Heroku

Deploy

Run /amesh commands on Slack

/amesh # displays weather map for Tokyo area
/amesh osaka now # displays a single image for Osaka area
/amesh hokkaido today # displays the transition of weather map in the last 24 hours for Hokkaido area

slack-weather-radar-map's People

Contributors

seratch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.