Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ototot/autoweatherptt
PTT天氣文自動發文機
https://github.com/ototot/autoweatherptt
cwb-api cwb-weather-data ptt python
Last synced: about 2 months ago
JSON representation
PTT天氣文自動發文機
- Host: GitHub
- URL: https://github.com/ototot/autoweatherptt
- Owner: oToToT
- Created: 2017-01-04T16:37:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-20T17:09:15.000Z (5 months ago)
- Last Synced: 2024-11-01T12:42:04.238Z (about 2 months ago)
- Topics: cwb-api, cwb-weather-data, ptt, python
- Language: Python
- Size: 41 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AutoWeatherPtt
Post daily weather information on pttbbs or any other bbs.
# Install
Install requirement from requirements.txt
```
$ pip install -r requirements.txt
```Run weather.py with Python(>=3.7) and load config from command line
```
./weather.py exec [-h] -u USERNAME -p PASSWORD -k APIKEY -b BOARD [-c HOST] [-o ORIGIN]
```Run weather.py with Python(>=3.7) and load config from config.json
```
./weather.py config [-h] filepath
```## Argument Information
Argument Name | Alias | Description
--------------|--------|-------------------------
--username | -u | username of bbs to login
--password | -p | password of bbs to login
--apikey | -k | apikey of cwb opendata
--board | -b | board to post
--host | -c | websocket endpoint
--origin | -o | original website url## Config Spec
A JSON file as below is required
```json
{
"username": "oToToT",
"password": "******",
"board": "Weather",
"apikey": "CWB-********-****-****-****-************",
"host": "wss://ws.ptt2.cc/bbs",
"origin": "https://term.ptt2.cc"
}
```