From 9f6a41dc0563e92cb59609aa3dcc8b9d42d1d40b Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 4 Sep 2012 12:25:08 +0200 Subject: fix fetching forecast from bom.gov.au https://github.com/mate-desktop/libmateweather/issues/1 https://bugzilla.gnome.org/show_bug.cgi?id=628750 http://git.gnome.org/browse/libgweather/commit/?id=a80552f51c641754ef8410eebea6debc23a25561 --- libmateweather/weather-bom.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/libmateweather/weather-bom.c b/libmateweather/weather-bom.c index ab0e558..aab6c8b 100644 --- a/libmateweather/weather-bom.c +++ b/libmateweather/weather-bom.c @@ -26,24 +26,6 @@ #include "weather.h" #include "weather-priv.h" -static gchar * -bom_parse (const gchar *meto) -{ - gchar *p, *rp; - - g_return_val_if_fail (meto != NULL, NULL); - - p = strstr (meto, "
");
-    g_return_val_if_fail (p != NULL, NULL);
-
-    rp = strstr (p, "
"); - g_return_val_if_fail (rp !=NULL, NULL); - - p += 5; /* skip the
 */
-
-    return g_strndup (p, rp-p);
-}
-
 static void
 bom_finish (SoupSession *session, SoupMessage *msg, gpointer data)
 {
@@ -58,7 +40,7 @@ bom_finish (SoupSession *session, SoupMessage *msg, gpointer data)
 	return;
     }
 
-    info->forecast = bom_parse (msg->response_body->data);
+    info->forecast = g_strdup (msg->response_body->data);
     request_done (info, TRUE);
 }
 
@@ -71,7 +53,7 @@ bom_start_open (WeatherInfo *info)
 
     loc = info->location;
 
-    url = g_strdup_printf ("http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?%s.txt",
+    url = g_strdup_printf ("http://www.bom.gov.au/fwo/%s.txt",
 			   loc->zone + 1);
 
     msg = soup_message_new ("GET", url);
-- 
cgit v1.2.1