commit 881d60cb8e21cf74d60f18f42072e3462900a8f3 Author: Simon Bußmann Date: Tue Nov 28 01:20:16 2023 +0100 added first rough version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b694934 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv \ No newline at end of file diff --git a/getStats.py b/getStats.py new file mode 100644 index 0000000..9ba6c57 --- /dev/null +++ b/getStats.py @@ -0,0 +1,31 @@ +from urllib.request import urlopen +from bs4 import BeautifulSoup +from pytimeparse import parse +from matplotlib import pyplot as plt + +url = "https://pwning.sec.in.tum.de/scoreboard/" + +page = urlopen(url) + +content = BeautifulSoup(page.read().decode(), 'html.parser') + +teams = content.find_all("a", class_="link-underline link-underline-opacity-0 link-underline-opacity-100-hover", title=True) +names = [team.get_text() for team in teams] +times_with_points = [team['title'] for team in teams] +times = [parse(time_with_points.split('/')[0].strip()) / 3600 for time_with_points in times_with_points] +points = [int(time_with_points.split('/')[1].strip()) for time_with_points in times_with_points] +# filter out teams with no time entry +times = [time for time in times if time > 0] +points = points[0:len(times)] +names = names[0:len(times)] + +fig, ax = plt.subplots() + +ax.plot(names, times, 'o-', label='Binex Times') +# Annotate each data point with its x-axis value +for x, y in zip(names, times): + ax.annotate(f'{x}', (x, y), textcoords="offset points", xytext=(0,10), ha='center') + +ax.legend() + +plt.show() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2175de3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +beautifulsoup4==4.12.2 +bs4==0.0.1 +contourpy==1.2.0 +cycler==0.12.1 +fonttools==4.45.1 +kiwisolver==1.4.5 +matplotlib==3.8.2 +numpy==1.26.2 +packaging==23.2 +Pillow==10.1.0 +pyparsing==3.1.1 +python-dateutil==2.8.2 +pytimeparse==1.1.8 +six==1.16.0 +soupsieve==2.5