[libgweather/wip/hadess/more-debug: 2/2] iwin: Add more debug to iwin parsing
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/wip/hadess/more-debug: 2/2] iwin: Add more debug to iwin parsing
- Date: Sat, 9 Mar 2019 10:50:47 +0000 (UTC)
commit a930c3e07691ab6bb9c740f0a97a7eb08dd9c4d9
Author: Bastien Nocera <hadess hadess net>
Date: Sat Mar 9 11:48:22 2019 +0100
iwin: Add more debug to iwin parsing
libgweather/weather-iwin.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/libgweather/weather-iwin.c b/libgweather/weather-iwin.c
index 5146d76..c932651 100644
--- a/libgweather/weather-iwin.c
+++ b/libgweather/weather-iwin.c
@@ -328,6 +328,9 @@ iwin_finish (SoupSession *session, SoupMessage *msg, gpointer data)
return;
}
+ g_debug ("iwin data for %s", loc->zone);
+ g_debug ("%s", msg->response_body->data);
+
priv = info->priv;
priv->forecast_list = parseForecastXml (msg->response_body->data, info);
@@ -354,8 +357,11 @@ iwin_start_open (GWeatherInfo *info)
/* No zone (or -) means no weather information from national offices.
We don't actually use zone, but it's a good indicator of a US location.
(@ and : prefixes were used in the past for Australia and UK) */
- if (!loc->zone || loc->zone[0] == '-' || loc->zone[0] == '@' || loc->zone[0] == ':')
+ if (!loc->zone || loc->zone[0] == '-' || loc->zone[0] == '@' || loc->zone[0] == ':') {
+ g_debug ("iwin_start_open, ignoring location because zone '%s' has no weather info",
+ loc->name, loc->zone ? loc->zone : "(empty)");
return FALSE;
+ }
if (!loc->latlon_valid)
return FALSE;
@@ -368,6 +374,7 @@ iwin_start_open (GWeatherInfo *info)
g_ascii_dtostr (lonstr, sizeof(lonstr), RADIANS_TO_DEGREES (loc->longitude));
url = g_strdup_printf
("http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?&lat=%s&lon=%s&format=24+hourly&startDate=%04d-%02d-%02d&numDays=7",
latstr, lonstr, 1900 + tm.tm_year, 1 + tm.tm_mon, tm.tm_mday);
+ g_debug ("iwin_start_open, requesting: %s", url);
msg = soup_message_new ("GET", url);
_gweather_info_begin_request (info, msg);
soup_session_queue_message (priv->session, msg, iwin_finish, info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]