
このGnomeアプレットはどのように天気情報を取得しますか?日の出時間と日没時間も同じです。
Web APIを照会すると予想されます。しかし、どのAPIを使用できますか?
(申し訳ありませんが、スクリーンショットはフランス語です。)
答え1
gnome-weather
使用libgweather
以下では、いくつかが順番に使用されますGWeatherProviders
(で定義されています)。gweather-weather.h
)特定の場所に関する天気情報を入手してください。
* GWeatherProvider:
....
* @GWEATHER_PROVIDER_METAR: METAR office, providing current conditions worldwide
* @GWEATHER_PROVIDER_IWIN: US weather office, providing 7 days of forecast
* @GWEATHER_PROVIDER_YAHOO: Yahoo Weather Service, removed in 3.27.1
* @GWEATHER_PROVIDER_YR_NO: Yr.no service, worldwide but requires attribution
* @GWEATHER_PROVIDER_OWM: OpenWeatherMap, worldwide and possibly more reliable, but requires attribution and is limited in the number of queries
....
ソースコードを確認して、どのように実行されるかを確認できます。
weather-metar.c
、
weather-iwin.c
、
weather-yrno.c
、
weather-owm.c
。また、見ることができますweather.c
日の出と日の入り時間は次のように計算されます。weather-sun.c