-
-
Save quozl/3f272f261b29ef6569e8b7b7f320bee7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
# generate list of translation contributors for sugar and sugar-toolkit-gtk3 | |
# by james cameron, 25th september 2017 | |
from lxml import html | |
import requests | |
import os | |
cache = '/tmp/translate-sugarlabs-org-sucrose-contributors.html' | |
if not os.access(cache, os.R_OK): | |
page = requests.get('https://translate.sugarlabs.org/about/contributors/') | |
content = page.content | |
file(cache, 'w').write(content) | |
else: | |
content = file(cache, 'r').read() | |
tree = html.fromstring(content) | |
users = [] | |
for lang in tree.find_class('lang'): | |
for proj in lang.find_class('proj'): | |
name = proj.text.strip() | |
if name == 'sugar' or name == 'sugar-toolkit-gtk3': | |
for user in proj.find_class('user'): | |
name = user.text.strip() | |
if name not in users: | |
users.append(name) | |
users.sort() | |
for name in users: | |
print name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment