weather.com site since this data is aggregated
into the cloud_cover one</option>
</member>
+ <member>
+ <command>icon</command>
+ <option>Weather icon (only for www.weather.com).
+ Can be used together with the icon kit provided
+ upon registering to their service.</option>
+ </member>
</simplelist>
<para>'delay_in_minutes' (optional, default 30) cannot
be lower than 30 min.</para>
#include <libxml/xpath.h>
/* Xpath expressions for XOAP xml parsing */
-#define NUM_XPATH_EXPRESSIONS 7
+#define NUM_XPATH_EXPRESSIONS 8
const char *xpath_expression[NUM_XPATH_EXPRESSIONS] = {
"/weather/cc/lsup", "/weather/cc/tmp", "/weather/cc/t",
"/weather/cc/bar/r", "/weather/cc/wind/s", "/weather/cc/wind/d",
- "/weather/cc/hmid"
+ "/weather/cc/hmid", "/weather/cc/icon"
};
#endif /* XOAP */
break;
case 6:
res->hmid = atoi(content);
+ break;
+ case 7:
+ strncpy(res->icon, content, 2);
}
xmlFree(content);
}
} else {
strncpy(p, "cumulonimbus", p_max_size);
}
+#ifdef XOAP
+ } else if (strcmp(data_type, "icon") == EQUAL) {
+ strncpy(p, data->icon, p_max_size);
+#endif /* XOAP */
} else if (strcmp(data_type, "pressure") == EQUAL) {
snprintf(p, p_max_size, "%d", data->bar);
} else if (strcmp(data_type, "wind_speed") == EQUAL) {
char lastupd[32];
#ifdef XOAP
char xoap_t[32];
- /*
- * TODO:
- * Is it worth investigating about using icons from weather.com?
- * We could use them for data from noaa as well.
- * They can display nicely with cimlib_add_image (with appropriate
- * #ifdefs on imlib2 and x11), and an additional input argoment for position.
-
- char icon[3];
-
- */
+ char icon[3];
#endif /* XOAP */
int temp;
int dew;