+------------+--------------+
| day | num_finishes |
+------------+--------------+
| 2023-06-01 | 815 |
| 2023-06-02 | 837 |
| 2023-06-03 | 847 |
| 2023-06-04 | 928 |
| 2023-06-05 | 720 |
| 2023-06-06 | 754 |
| 2023-06-07 | 708 |
| 2023-06-08 | 695 |
| 2023-06-09 | 787 |
| 2023-06-10 | 861 |
| 2023-06-11 | 920 |
| 2023-06-12 | 682 |
| 2023-06-13 | 588 |
| 2023-06-14 | 718 |
| 2023-06-15 | 634 |
| 2023-06-16 | 685 |
| 2023-06-17 | 804 |
| 2023-06-18 | 787 |
| 2023-06-19 | 983 |
| 2023-06-20 | 786 |
| 2023-06-21 | 735 |
| 2023-06-22 | 301 |
+------------+--------------+
+------------+--------------+
| day | num_finishes |
+------------+--------------+
| 2023-06-01 | 815 |
| 2023-06-02 | 837 |
| 2023-06-03 | 847 |
| 2023-06-04 | 928 |
| 2023-06-05 | 720 |
| 2023-06-06 | 754 |
| 2023-06-07 | 708 |
| 2023-06-08 | 695 |
| 2023-06-09 | 787 |
| 2023-06-10 | 861 |
| 2023-06-11 | 920 |
| 2023-06-12 | 682 |
| 2023-06-13 | 588 |
| 2023-06-14 | 718 |
| 2023-06-15 | 634 |
| 2023-06-16 | 685 |
| 2023-06-17 | 804 |
| 2023-06-18 | 787 |
| 2023-06-19 | 983 |
| 2023-06-20 | 786 |
| 2023-06-21 | 735 |
| 2023-06-22 | 301 |
+------------+--------------+
2020-09-20 2192
2021-03-13 1716
2021-04-17 1702
2021-05-02 1585
2021-03-07 1583
2021-03-14 1575
2021-04-18 1571
2022-12-01 1555
2021-08-05 1529
2021-05-04 1519
…
2022-11-01 519
2021-11-15 505
2023-03-23 502
2022-12-12 498
2023-04-27 492
2023-04-13 489
2021-11-11 457
2022-10-19 437
2022-10-27 426
2020-09-19 45
# License: GNU Affero General Public License v3.0
import requests
import urllib.parse
def scrape(player_name):
player_url = urllib.parse.quote(player_name)
url = f'https://ddnet.org/players/?json2={player_url}'
data = requests.get(url).json()
return data
def get_data(data):
total_points = []
points = []
for category in data['types']:
category = data['types'][category]
for map in category['maps']:
maps = category['maps']
total_points.append(maps[map]['points'] * maps[map]['finishes'])
if 'rank' in maps[map]:
points.append(maps[map]['points'])
return total_points, points
player_name = "" # Change this
data = scrape(player_name)
total_points, points = get_data(data)
total_points = sum(total_points)
points = sum(points)
print(f"{player_name}: {points} | {total_points}")
heres the wonderful script xd (edited)# License: GNU Affero General Public License v3.0
- The freedom to run the program as you wish, for any purpose (freedom 0).
- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
- The freedom to redistribute copies so you can help your neighbor (freedom 2).
- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
# License: GNU Affero General Public License v3.0
import requests
import urllib.parse
def scrape(player_name):
player_url = urllib.parse.quote(player_name)
url = f'https://ddnet.org/players/?json2={player_url}'
data = requests.get(url).json()
return data
def get_data(data):
total_points = []
points = []
for category in data['types']:
category = data['types'][category]
for map in category['maps']:
maps = category['maps']
total_points.append(maps[map]['points'] * maps[map]['finishes'])
if 'rank' in maps[map]:
points.append(maps[map]['points'])
return total_points, points
player_name = "" # Change this
data = scrape(player_name)
total_points, points = get_data(data)
total_points = sum(total_points)
points = sum(points)
print(f"{player_name}: {points} | {total_points}")
heres the wonderful script xd (edited)