Added more APIs.

Signed-off-by: imi415 <imi415.public@gmail.com>
This commit is contained in:
imi415 2021-05-05 21:28:53 +08:00
parent 89798c0fee
commit 5a08ea60b4
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
2 changed files with 18 additions and 0 deletions

View File

@ -11,4 +11,7 @@ result = client.query MojiWeather::Api::ApiType::AQI, city_id: 2
`ApiType` has the following possible values (more is WIP):
* `MojiWeather::Api::ApiType::CONDITION`: Real-time condition
* `MojiWeather::Api::ApiType::FORECAST_24HRS`: 24-hour forecast
* `MojiWeather::Api::ApiType::FORECAST_15DAYS`: 15-day forecast
* `MojiWeather::Api::ApiType::LIMIT`: Number plate limitation for vehicles in certain cities
* `MojiWeather::Api::ApiType::LIFE_INDEX`: Useful life tips and index score based on weather (in Chinese)
* `MojiWeather::Api::ApiType::AQI`: Air quality index(AQI)

View File

@ -3,7 +3,10 @@ module MojiWeather
module ApiType
CONDITION = 'condition'
FORECAST_24HRS = 'forecast24hours'
FORECAST_15DAYS = 'forecast15days'
AQI = 'aqi'
LIMIT = 'limit'
LIFE_INDEX = 'index'
end
module Constants
@ -19,6 +22,18 @@ module MojiWeather
MojiWeather::Api::ApiType::AQI => {
city_id: '8b36edf8e3444047812be3a59d27bab9',
location: '6e9a127c311094245fc1b2aa6d0a54fd'
},
MojiWeather::Api::ApiType::LIMIT => {
city_id: '27200005b3475f8b0e26428f9bfb13e9',
location: 'c712899b393c7b262dd7984f6eb52657'
},
MojiWeather::Api::ApiType::LIFE_INDEX => {
city_id: '5944a84ec4a071359cc4f6928b797f91',
location: '42b0c7e2e8d00d6e80d92797fe5360fd'
},
MojiWeather::Api::ApiType::FORECAST_15DAYS => {
city_id: 'f9f212e1996e79e0e602b08ea297ffb0',
location: '7538f7246218bdbf795b329ab09cc524'
}
}
end