forked from dag/vlasisku
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jbovlaste xml export download script
The readme is also amended to use this script rather than wget, since the introduction of the captcha on jbovlaste has broken the old way. Closes #4
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python | ||
|
||
import requests | ||
|
||
CREDENTIALS = dict( | ||
username='YOUR JBOVLASTE USERNAME', | ||
password='YOUR JBOVLASTE PASSWORD', | ||
) | ||
|
||
# jbovlaste definitions language to download | ||
LANG = 'en' | ||
|
||
if __name__ == '__main__': | ||
s = requests.Session() | ||
r = s.post( | ||
'http://jbovlaste.lojban.org/login.html', | ||
data=CREDENTIALS, | ||
) | ||
r.raise_for_status() | ||
|
||
r = s.get( | ||
'http://jbovlaste.lojban.org/export/xml-export.html?lang=' + LANG, | ||
) | ||
|
||
r.raise_for_status() | ||
|
||
with open('vlasisku/data/jbovlaste.xml', 'wb') as f: | ||
f.write(r.text.encode('utf-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ simplejson | |
pystemmer | ||
Twisted | ||
jellyfish | ||
requests |