File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 22import io
33import urllib .parse
44import zipfile
5+ from logging import info
56
67from urllib3 import PoolManager
78
@@ -10,9 +11,12 @@ def get_number_of_visitors(language: str, http: PoolManager) -> int:
1011 params = urllib .parse .urlencode (
1112 {'filters' : f'[["contains","event:page",["/{ language } /"]]]' , 'period' : 'all' }
1213 )
13- r = http .request ('GET' , f'https://plausible.io/docs.python.org/export?{ params } ' )
14+ response = http .request (
15+ 'GET' , f'https://plausible.io/docs.python.org/export?{ params } '
16+ )
17+ info (f'visitors { response .status = } ({ language = } )' )
1418 with (
15- zipfile .ZipFile (io .BytesIO (r .data ), 'r' ) as z ,
19+ zipfile .ZipFile (io .BytesIO (response .data ), 'r' ) as z ,
1620 z .open ('visitors.csv' ) as csv_file ,
1721 ):
1822 csv_reader = csv .DictReader (io .TextIOWrapper (csv_file ))
You can’t perform that action at this time.
0 commit comments