Compare commits

2 Commits

Author SHA1 Message Date
10aeabdb83 increase allowed range for prediction 2023-10-05 02:29:39 +02:00
5604fac1b2 readjust step in predict and add dateformating function 2023-10-05 02:19:52 +02:00
3 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
__pycacahe__/*
freeriders/__pycacahe__/*
instance/

View File

@@ -1,4 +1,9 @@
import time
import datetime
def datetounix(day, month, year, hour, minute, second):
seconds = datetime.datetime(year, month, day, hour, minute, second).timestamp()
return int(seconds)
def formatprefix2(number):
return "{:02d}".format(number)
@@ -7,10 +12,10 @@ def formatprefix10(number):
return "{:010d}".format(number)
def predict(timestamp):
base_ticket = 4339636
base_timestamp = 1694003498
step = 8
base_ticket = 7157662
base_timestamp = 1695887564
step = 0.688
ticket = base_ticket + (timestamp - base_timestamp) * step
return ticket
return int(ticket)

View File

@@ -5,7 +5,6 @@ from freeriders.models import Tickets
from datetime import datetime
import time
@app.route('/sms', methods=['GET'])
def sms():
if request.method == 'GET':
@@ -29,7 +28,7 @@ def sms():
@app.route('/submit', methods=['POST', 'GET'])
def submit():
PREDICTTIMERANGE = 60 * 80
PREDICTTIMERANGE = 60 * 60 * 24
if request.method == 'GET':
return render_template('submit.html')
elif request.method == 'POST':