[libgweather] Fix fetching forecast from bom.gov.au



commit a80552f51c641754ef8410eebea6debc23a25561
Author: Johnny <johnnybg+gnome+bugz gmail com>
Date:   Mon Oct 24 16:08:36 2011 +0200

    Fix fetching forecast from bom.gov.au
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628750

 libgweather/weather-bom.c |   22 ++--------------------
 1 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/libgweather/weather-bom.c b/libgweather/weather-bom.c
index e18f446..7176d4f 100644
--- a/libgweather/weather-bom.c
+++ b/libgweather/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, "<pre>");
-    g_return_val_if_fail (p != NULL, NULL);
-
-    rp = strstr (p, "</pre>");
-    g_return_val_if_fail (rp !=NULL, NULL);
-
-    p += 5; /* skip the <pre> */
-
-    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);



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