diff --git a/main.py b/main.py index 919d311..c1cf6e6 100644 --- a/main.py +++ b/main.py @@ -37,7 +37,7 @@ def application(env, re): yield "\"from\" and \"to\" values are required for this type of request.".encode() return - count = args["count"][0] if "count" in args and args["count"] else 1 + count = args["count"][0] if "count" in args and args["count"] else 3 date = args["date"][0] if "date" in args and args["date"] else datetime.datetime.strftime(datetime.datetime.now(pytz.timezone("Europe/Vienna")),"%d.%m.%Y") time = args["time"][0] if "time" in args and args["time"] else datetime.datetime.strftime(datetime.datetime.now(pytz.timezone("Europe/Vienna")),"%H:%M") mode = True if "mode" in args and args["mode"] and args["mode"][0].lower() == "arr" else False diff --git a/workers/conn.py b/workers/conn.py index a425653..464b197 100644 --- a/workers/conn.py +++ b/workers/conn.py @@ -96,7 +96,7 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False depst = getStation(stations[0].text.strip()) arrst = getStation(stations[-1].text.strip()) - dates = det.find("td", { "class": "date" }).text.split() + dates = list(det.find("td", { "class": "date" }).strings) depdate = dates[0] try: arrdate = dates[1] @@ -167,7 +167,7 @@ def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europ %i -""" % (i, conn.depst().name, conn.depst().useId(), conn.arrst().name, conn.arrst().useId(), ddt, dtm, adt, atm, "%i:%i" % (hrs, mns), chg) +""" % (i, conn.depst().name, conn.depst().useId(), conn.arrst().name, conn.arrst().useId(), ddt, dtm, adt, atm, "%i:%s" % (hrs, str(int(mns)).zfill(2)), chg) j = 0