Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j-hoplin/weather_hook
Weather Web Hook for Discord & Slack
https://github.com/j-hoplin/weather_hook
discord weather-app webhook
Last synced: 14 days ago
JSON representation
Weather Web Hook for Discord & Slack
- Host: GitHub
- URL: https://github.com/j-hoplin/weather_hook
- Owner: J-Hoplin
- Created: 2022-07-28T15:41:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-08T18:50:37.000Z (almost 2 years ago)
- Last Synced: 2024-01-15T21:58:51.686Z (11 months ago)
- Topics: discord, weather-app, webhook
- Language: TypeScript
- Homepage:
- Size: 452 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Weather Hook for Discord
===
***
**[Discord](https://discord.com/) 플랫폼을 위한 날씨/대기 정보 웹훅 애플리케이션 소스코드입니다**
***
## How to use?0. Prepare [Openweather Map](https://openweathermap.org)'s API key. You need to subscribe apis under below
- [Weather Data](https://openweathermap.org/current)
- [Airpollution Data](https://openweathermap.org/api/air-pollution)
- [Geo-Coding Data](https://openweathermap.org/api/geocoding-api)
1. Git Clone```bash
git clone https://github.com/J-hoplin1/Weather_Hook.git && cd Weather_Hook
```2. Complete application config. There are three types of config
- scheduler : Crontab Expression
- region : Please follow format as under below
```json
...
"region" : [
{
"hook" : "Your discord web hook endpoint",
"region" : "Supported Region (ex. 'seoul')"
}
]
...
```
- You can see supported region in this [link](./src/constant/region.ts)
- specified : Please follow format as under below
```json
...
"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
```json
{
"scheduler": "0 */4 * * *",
"region": [
{
"hook": "hook endpoint",
"region": "seoul"
}
],
"specified": [
{
"hook": "hook endpoint",
"location": [
36.6210720,
127.2868270,
"school"
]
}
]
}
```
3. Build docker
```bash
docker build -t (image name) .
```
4. Run docker container. **Be aware that you need Openweather map API key in this step**- Mountable container volume
- /app/dist/logfile : logfiles directory```bash
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)
```