[libgweather] Remove Yahoo! Weather support



commit dfc874428dcbede29f0c5d2d508f8741224dcd3c
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Dec 1 14:12:03 2017 +0100

    Remove Yahoo! Weather support
    
    The RSS feed URL was moved from:
    https://weather.yahooapis.com/forecastrss
    to:
    https://weather-ydn-yql.media.yahoo.com/forecastrss
    as per https://developer.yahoo.com/weather/documentation.html
    
    But this new location requires use of OAuth to link the API to the
    application. Given that we relied on the URL to be freely accessible,
    and that we have so few locations with a Yahoo "Where On Earth" ID set,
    we might as well remove the code to avoid failing to fetch the weather
    for those locations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791084

 data/Locations.xml              |    4 -
 data/locations.dtd              |    3 +-
 libgweather/gweather-location.c |   12 +--
 libgweather/gweather-private.h  |    4 +-
 libgweather/gweather-weather.c  |    7 -
 libgweather/gweather-weather.h  |    2 +-
 libgweather/meson.build         |    1 -
 libgweather/weather-yahoo.c     |  288 ---------------------------------------
 po-locations/POTFILES.skip      |    1 -
 po/POTFILES.in                  |    1 -
 10 files changed, 4 insertions(+), 319 deletions(-)
---
diff --git a/data/Locations.xml b/data/Locations.xml
index 03600bf..6a6277f 100644
--- a/data/Locations.xml
+++ b/data/Locations.xml
@@ -5715,7 +5715,6 @@
         <location>
           <name>Kimp'o International Airport</name>
           <code>RKSS</code>
-          <yahoo-woeid>1132599</yahoo-woeid>
           <coordinates>37.550000 126.800000</coordinates>
         </location>
       </city>
@@ -16256,7 +16255,6 @@
           <location>
             <name>Linate Airport</name>
             <code>LIML</code>
-           <yahoo-woeid>718345</yahoo-woeid>
             <coordinates>45.433333 9.283333</coordinates>
           </location>
           <location>
@@ -20096,7 +20094,6 @@
         <location>
           <name>Vigo Airport, Peinador</name>
           <code>LEVX</code>
-          <yahoo-woeid>777341</yahoo-woeid>
           <coordinates>42.216667 -8.633333</coordinates>
         </location>
       </city>
@@ -21650,7 +21647,6 @@
             <name>Manchester Airport</name>
             <code>EGCC</code>
             <zone>:nw</zone>
-            <yahoo-woeid>28218</yahoo-woeid>
             <coordinates>53.350000 -2.283333</coordinates>
           </location>
         </city>
diff --git a/data/locations.dtd b/data/locations.dtd
index 6aadee9..7a3c99b 100644
--- a/data/locations.dtd
+++ b/data/locations.dtd
@@ -9,7 +9,7 @@
 <!ELEMENT state (%name;, fips-code+, tz-hint?, (location|city)*) >
 <!ELEMENT province (%name;, (location|city)*) >
 <!ELEMENT city (%name;, coordinates?, tz-hint?, location+) >
-<!ELEMENT location (%name;, code, zone?, yahoo-woeid?, radar?, coordinates?) >
+<!ELEMENT location (%name;, code, zone?, radar?, coordinates?) >
 
 <!ELEMENT timezones (timezone+) >
 <!ELEMENT timezone (_name?, name*, obsoletes*) >
@@ -32,4 +32,3 @@
 <!ELEMENT zone (#PCDATA) >
 <!ELEMENT radar (#PCDATA) >
 <!ELEMENT coordinates (#PCDATA) >
-<!ELEMENT yahoo-woeid (#PCDATA) >
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index cde231c..500ff80 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -213,12 +213,6 @@ location_new_from_xml (GWeatherParser *parser, GWeatherLocationLevel level,
                goto error_out;
            loc->forecast_zone = g_strdup (value);
            xmlFree (value);
-       } else if (!strcmp (tagname, "yahoo-woeid") && !loc->yahoo_id) {
-           value = _gweather_parser_get_value (parser);
-           if (!value)
-               goto error_out;
-           loc->yahoo_id = g_strdup (value);
-           xmlFree (value);
        } else if (!strcmp (tagname, "radar") && !loc->radar) {
            value = _gweather_parser_get_value (parser);
            if (!value)
@@ -403,7 +397,6 @@ gweather_location_unref (GWeatherLocation *loc)
     g_free (loc->tz_hint);
     g_free (loc->station_code);
     g_free (loc->forecast_zone);
-    g_free (loc->yahoo_id);
     g_free (loc->radar);
 
     if (loc->children) {
@@ -1084,7 +1077,7 @@ void
 _gweather_location_update_weather_location (GWeatherLocation *gloc,
                                            WeatherLocation  *loc)
 {
-    const char *code = NULL, *zone = NULL, *yahoo_id = NULL, *radar = NULL, *tz_hint = NULL, *country = NULL;
+    const char *code = NULL, *zone = NULL, *radar = NULL, *tz_hint = NULL, *country = NULL;
     gboolean latlon_valid = FALSE;
     gdouble lat = DBL_MAX, lon = DBL_MAX;
     GWeatherLocation *l;
@@ -1099,8 +1092,6 @@ _gweather_location_update_weather_location (GWeatherLocation *gloc,
            code = l->station_code;
        if (!zone && l->forecast_zone)
            zone = l->forecast_zone;
-       if (!yahoo_id && l->yahoo_id)
-           yahoo_id = l->yahoo_id;
        if (!radar && l->radar)
            radar = l->radar;
        if (!tz_hint && l->tz_hint)
@@ -1118,7 +1109,6 @@ _gweather_location_update_weather_location (GWeatherLocation *gloc,
     loc->name = g_strdup (gloc->local_name),
     loc->code = g_strdup (code);
     loc->zone = g_strdup (zone);
-    loc->yahoo_id = g_strdup (yahoo_id);
     loc->radar = g_strdup (radar);
     loc->country_code = g_strdup (country);
     loc->tz_hint = g_strdup (tz_hint);
diff --git a/libgweather/gweather-private.h b/libgweather/gweather-private.h
index e2244bb..ddf0a41 100644
--- a/libgweather/gweather-private.h
+++ b/libgweather/gweather-private.h
@@ -38,7 +38,7 @@ struct _GWeatherLocation {
     GWeatherLocation *parent, **children;
     GWeatherLocationLevel level;
     char *country_code, *tz_hint;
-    char *station_code, *forecast_zone, *yahoo_id, *radar;
+    char *station_code, *forecast_zone, *radar;
     double latitude, longitude;
     gboolean latlon_valid;
     GWeatherTimezone **zones;
@@ -55,7 +55,6 @@ typedef struct {
     gchar *name;
     gchar *code;
     gchar *zone;
-    gchar *yahoo_id;
     gchar *radar;
     gboolean latlon_valid;
     gdouble  latitude;
@@ -181,7 +180,6 @@ struct _GWeatherInfoPrivate {
 void           metar_start_open        (GWeatherInfo *info);
 gboolean       iwin_start_open         (GWeatherInfo *info);
 void           wx_start_open           (GWeatherInfo *info);
-gboolean        yahoo_start_open        (GWeatherInfo *info);
 gboolean        yrno_start_open         (GWeatherInfo *info);
 gboolean        owm_start_open          (GWeatherInfo *info);
 
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index be08c8d..9f95e34 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -104,7 +104,6 @@ _weather_location_free (WeatherLocation *location)
     g_free (location->name);
     g_free (location->code);
     g_free (location->zone);
-    g_free (location->yahoo_id);
     g_free (location->radar);
     g_free (location->country_code);
     g_free (location->tz_hint);
@@ -675,12 +674,6 @@ gweather_info_update (GWeatherInfo *info)
     if (ok)
        return;
 
-    /* Try Yahoo! Weather next */
-    if (priv->providers & GWEATHER_PROVIDER_YAHOO)
-       ok = yahoo_start_open (info);
-    if (ok)
-       return;
-
     /* Try yr.no next */
     if (priv->providers & GWEATHER_PROVIDER_YR_NO)
        ok = yrno_start_open (info);
diff --git a/libgweather/gweather-weather.h b/libgweather/gweather-weather.h
index 75bb36c..a251b1f 100644
--- a/libgweather/gweather-weather.h
+++ b/libgweather/gweather-weather.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
  * @GWEATHER_PROVIDER_NONE: no provider, no weather information available
  * @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, worldwide but non commercial only
+ * @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
  * @GWEATHER_PROVIDER_ALL: enable all available providers
diff --git a/libgweather/meson.build b/libgweather/meson.build
index d33ded4..ad038db 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -45,7 +45,6 @@ gweather_c_sources = [
   'gweather-weather.c',
   'weather-metar.c',
   'weather-iwin.c',
-  'weather-yahoo.c',
   'weather-wx.c',
   'weather-yrno.c',
   'weather-owm.c',
diff --git a/po-locations/POTFILES.skip b/po-locations/POTFILES.skip
index 586f407..bf7bad0 100644
--- a/po-locations/POTFILES.skip
+++ b/po-locations/POTFILES.skip
@@ -10,6 +10,5 @@ libgweather/weather-iwin.c
 libgweather/weather-metar.c
 libgweather/weather-owm.c
 libgweather/weather-wx.c
-libgweather/weather-yahoo.c
 libgweather/weather-yrno.c
 schemas/org.gnome.GWeather.gschema.xml
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 23b28da..fbb0e97 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,6 +11,5 @@ libgweather/weather-iwin.c
 libgweather/weather-metar.c
 libgweather/weather-owm.c
 libgweather/weather-wx.c
-libgweather/weather-yahoo.c
 libgweather/weather-yrno.c
 schemas/org.gnome.GWeather.gschema.xml


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]