From 5a08ea60b4f00e98496a38c9a2bcbec6aea6776e Mon Sep 17 00:00:00 2001 From: imi415 Date: Wed, 5 May 2021 21:28:53 +0800 Subject: [PATCH] Added more APIs. Signed-off-by: imi415 --- README.md | 3 +++ lib/moji_weather/api/constants.rb | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 6fad7a3..18e0bb8 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file diff --git a/lib/moji_weather/api/constants.rb b/lib/moji_weather/api/constants.rb index 35fd9a6..6b7631a 100644 --- a/lib/moji_weather/api/constants.rb +++ b/lib/moji_weather/api/constants.rb @@ -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