--- smsdaemon/plugins/TrainInfo.cpp 2008/06/12 12:47:32 64 +++ smsdaemon/plugins/TrainInfo.cpp 2008/12/08 21:49:49 158 @@ -2,10 +2,12 @@ #include "TrainInfo.h" #include "string_nocase.h" -#include "util.h" +#include "Util.h" #include #include +#include + using namespace std; @@ -59,6 +61,12 @@ string url = string("http://www.bane.dk/visStation.asp?W=FJRN&S=") + stationcode + "&artikelId=4275&statnavn=" + stationname; string raw_doc = Util::readUrl(url, "/tmp/sms_tog.tmp" ); + + if (raw_doc == "") + { + throw std::runtime_error("Connection timeout"); + } + raw_doc = Util::str_replace(raw_doc, "\"", "'"); string_nocase html = raw_doc.c_str();