--- smsdaemon/plugins/WeatherPlugin.cpp 2008/12/17 20:55:13 192 +++ smsdaemon/plugins/WeatherPlugin.cpp 2008/12/17 23:43:26 193 @@ -1,7 +1,8 @@ #include "WeatherPlugin.h" #include "ISmsTransceiver.h" #include "Sms.h" - +#include "HttpClient.h" +#include "Exceptions.h" #include "Util.h" using namespace std; @@ -14,7 +15,14 @@ void WeatherPlugin::Execute(ISmsTransceiver& modem, SMS& sms) { - string doc = Util::readUrl("http://www.dmi.dk/dmi/danmark.htm","/tmp/sms_vejr.tmp"); + string doc; + try + { + doc = HttpClient::GetString("http://www.dmi.dk/dmi/danmark.htm"); + } catch (httpexception&e ) { + modem.SendSms(sms.GetSender(), "could not retrieve data", true); + return; + } int pos = doc.find(""); int pos2 = doc.find("",pos);