Autosubmit

Dies ist eine Information für all jene, die Automaten-Tipps per Script abgeben wollen. Bald gibt es hier auch eine vollständige deutsche Beschreibung und ein kleines Update 😉

Bevor ihr euch die alte / neue Version durchlest: Wir haben ein sehr einfaches Python-Tool entwickelt, um automatische Abgaben zu realisieren. Ihr findet es hier direkt zum Download (autosubmit.py / version 0.2-1) oder auf github.

Achtung: https!

Im November 2018 haben wir von http zu https gewechselt auf www.wetterturnier.de. Das machte kleine Anpassungen in der Autosubmit-Routine notwendig! Wenn ihr den „alten“ wget Befehl nutzt, bitte achtet darauf, dass bei wget der Flag

gesetzt ist. Wenn ihr das autosubmit.py Skript nutzt, sollte eure URL wie folgt aussehen:

Danke und viel Spaß beim Tippen!

Alte Version der URL

Für unsere MOS/Statistik Experten haben wir eine erweiterte Version des „autosubmit“ Skripts entwickelt. Auf dem alten System sah die URL so oder so ähnlich aus:

wobei „aa“, „bb“, „cc“ die Parameter waren. Nicht sehr intuitiv aber diese „Syntax“ funktioniert immer noch, wenn man die Haupt-URL ändert:

Neue Version der URLs

Au Gründen der besseren Lesbarkeit und Flexibilität wurde eine neue Syntax entwickelt. URLs schauen nun so aus:

Unterschiede:

  • URL zu www.wetterturnier.de/autosubmit geändert
  • Städte umbenannt: „i“ or „w“ gibt es nicht mehr. Stattdessen jetzt „IBK“=“Innsbruck“, „VIE“=“Vienna“, „BER“=Berlin usw.
  • Parameter sind jetzt lesbarer (und bei Bedarf auch erweiterbar). Die Struktur ist immer <NAME>_<DAY> wobei <NAME> den Wetterturnier-Parameter darstellt (z.B., „N“, „TTm“, oder „Wv“) und <DAY> den vorhergesagten Tag. Wenn das Turnier an einem Freitag stattfindet, dann bedeutet „1“ Samstag und „2“ Sonntag.
  • bessere Server-Rückmeldung. Achtet auf den Output von wget! Der Server „sagt euch“, ob etwas schief läuft (z.B. Login falsch, Parameter falsch geschrieben, Turnier geschlossen oder fehlende Berechtigung).

###Übersetzung ENDE###

BUT there is a new very easy and intuitively to use tool now!

However, a lot of stuff can go wrong with the URL’s as they are not as easy to read at all. Therefore I wrote a small python script which does the submission for you. The only thing needed is a small ASCII-text file. The python code also returns error codes fetched from either wget or the server side autosubmit script on wetterturnier.de (e.g., if login was incorrect).

Script Usage:

Here is an example of such a file (note that the template contains some more comments and help descriptions, this is the short form):

NEW: the optional „tdate“ setting can be given e.g. to send a belated automaton/MOS submission. This is only allowed for „Wetterturnier Admin“ users (all MOSes have this capability)! The privileges get checked during the procedure and if the user sending the data is no admin, AUTOSUBMIT ERRORCODE 403 (like „FORBIDDEN„) is returned.

Additionally, if your „tdate“ was no valid tournament day, e.g. if you had a typo in it, AUTOSUBMIT ERRORCODE 404 (like „NOT FOUND„) is returned.

The python script can be found here (version 0.2-1) or on sferics‘ github including the template as shown above (autosubmit_example.txt). It has been developed for „python 2.7.6“ using base packages „optparse„, „ConfigParser„, „subprocess„, and „re„.

There are a few extra options, please call with option „–help“ to get the (minimalistic) usage of the script.

What happens if a parameter is missing

The script automatically checks if (for a given city) a parameter was not set. You’ll get a warning message and the script will stop – the data wont be stored in the database at all as we can’t judge bets where one or more forecasts are missing.

What happens if a day is missing

Here the same holds as for „a parameter is missing“. The script won’t store any data as we can’t judge bets with missing forecasts at all.

What if my script sends more data than expected?

Well, that’s no problem at all. The idea is that the wetterturnier takes what it needs. if you are delivering more data or more forecast days these days will be dropped. This gives you a note, but the necessary forecast values will be stored.

Additional parameter:

Additional day:

 

>> download autosubmit.py <<

github repository