Skip to content

J-Hoplin/Weather_Hook

Repository files navigation

Weather Hook for Discord


Discord 플랫폼을 위한 날씨/대기 정보 웹훅 애플리케이션 소스코드입니다


How to use?

  1. Prepare Openweather Map's API key. You need to subscribe apis under below

  2. Git Clone

    git clone https://github.com/J-hoplin1/Weather_Hook.git && cd Weather_Hook
  3. Complete application config. There are three types of config

    • scheduler : Crontab Expression

    • region : Please follow format as under below

      ...
      "region" : [
          {
              "hook" : "Your discord web hook endpoint",
              "region" : "Supported Region (ex. 'seoul')"
          }
      ]
      ...
      • You can see supported region in this link
    • specified : Please follow format as under below

      ...
      "specified" : [
          {
              "hook" : "Your discord web hook endpoint",
              "location" :[
                  "latitude value as integer type",
                  "longtitude value as integer type",
                  "location name you want to set as string type"
              ]
          }
      ]
      ...
    • JSON under below is example of config file

      {
          "scheduler": "0 */4 * * *",
          "region": [
              {
                  "hook": "hook endpoint",
                  "region": "seoul"
              }
          ],
          "specified": [
              {
                  "hook": "hook endpoint",
                  "location": [
                      36.6210720,
                      127.2868270,
                      "school"
                  ]
              }
          ]
      }
  4. Build docker

    docker build -t (image name) .
  5. Run docker container. Be aware that you need Openweather map API key in this step

    • Mountable container volume
      • /app/dist/logfile : logfiles directory
    docker run -d --name (container name) -e OPENWEATHER_API_KEY='(your openweathermap API Key)' -v (location you want to mount):/app/dist/logfile (image name)

About

Weather Web Hook for Discord & Slack

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published