Skip to content

Commit a2bd92b

Browse files
committed
Use Plausible export for period "all"
1 parent 310cc7b commit a2bd92b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

visitors.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88

99
def get_number_of_visitors(language: str) -> int:
10-
param = urllib.parse.urlencode(
11-
{'filters': f'[["contains","event:page",["/{language}/"]]]'}
10+
params = urllib.parse.urlencode(
11+
{'filters': f'[["contains","event:page",["/{language}/"]]]', 'period': 'all'}
12+
)
13+
r = requests.get(
14+
f'https://plausible.io/docs.python.org/export?{params}', timeout=20
1215
)
13-
r = requests.get(f'https://plausible.io/docs.python.org/export?{param}', timeout=20)
1416
with (
1517
zipfile.ZipFile(io.BytesIO(r.content), 'r') as z,
1618
z.open('visitors.csv') as csv_file,

0 commit comments

Comments
 (0)