summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-09-04 12:25:08 +0200
committerStefano Karapetsas <[email protected]>2012-09-04 12:25:08 +0200
commit9f6a41dc0563e92cb59609aa3dcc8b9d42d1d40b (patch)
tree58c3d74acb0bbc91da289cde8c884e190e7e9b73
parent859434d111af89e4ce2a0d4e6199b6f21305fa33 (diff)
downloadlibmateweather-9f6a41dc0563e92cb59609aa3dcc8b9d42d1d40b.tar.bz2
libmateweather-9f6a41dc0563e92cb59609aa3dcc8b9d42d1d40b.tar.xz
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
-rw-r--r--libmateweather/weather-bom.c22
1 files 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, "<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);