repl.it
@21natzil/

repl-data

Python

No description

fork
loading
Files
  • main.py
  • test.dat
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from requests_html import HTMLSession

session = HTMLSession()

def save_data(fp: str, data: list, title="Language count satistics"):
	with open(fp, "w") as f:
		f.write("# " + title + "\n")
		for stat in data:
			f.write(stat[0] + " " + str(stat[1] + "\n"))


def collect_repls(page):
	repls = page.html.find(".repls-page-list", first=True).element.getchildren()
	for repl in repls:
		data = repl.getchildren(0).getchildren()
		lang = data[3]


page = session.get("https://repl.it/site/repls")
import pdb; pdb.set_trace()
Fetching token
?