-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdl.py
33 lines (26 loc) · 1.03 KB
/
dl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import yaml
from subprocess import call
import urllib
YEAR = 2016
if __name__ == "__main__":
p = os.path.join(os.path.expanduser('~'), ".ecf2017")
f = yaml.load(open(p, 'r'))
usr = urllib.quote_plus(f['user'])
pwd = urllib.quote_plus(f['pwd'])
cmd = ['wget',
'--save-cookies', 'cookies.txt',
'--post-data', 'name=%s&pass=%s&form_build_id=form--wyE7ecVE7aujFTM9ylmm-fIRruT1qmVuEqTDoRtGEc&form_id=user_login&op=Log+in' % (usr, pwd),
'https://www.eclipsecon.org/france2017/user/login' % YEAR]
call(cmd)
os.remove("./login")
cmd = ['wget',
'--load-cookies', 'cookies.txt',
'-O', 'submissions.csv',
'https://www.eclipsecon.org/france2017/pc-admin/sessions/eclipsecon-admin-unprocessed.csv?order=value_2&sort=asc' % YEAR]
call(cmd)
cmd = ['wget',
'--load-cookies', 'cookies.txt',
'-O', 'community-votes.csv',
'https://www.eclipsecon.org/france2017/community-voting/report.csv' % YEAR]
call(cmd)