Skip to content

Commit

Permalink
Merge pull request #3 from CyrilleFranchet/master
Browse files Browse the repository at this point in the history
Reflect root-me website changes
  • Loading branch information
mpgn committed Mar 22, 2020
2 parents 267195a + 5fe734d commit de4e925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions updater/update.py
Expand Up @@ -17,7 +17,7 @@ def update_users(user):
r = requests.get('https://www.root-me.org/'+ user['username'] + '?inc=score')
user['username'] = html.escape(user['username'])

regex = r'<h1 itemprop="givenName">.*<span .*?>(.*)</span></h1>'
regex = r'<h1 itemprop="givenName">[\n]{0,}.*[\n]{0,}<span .*?>(.*)</span>&nbsp'
matches = re.search(regex, r.text)
if matches:
user['username_r'] = html.escape("{group}".format(group = matches.group(1)))
Expand All @@ -44,7 +44,7 @@ def update_users(user):
user['challenges'] = "{group}".format(group = matches.group(1))
total_challenge = "{group}".format(group = matches.group(2))

regex = r'<h1 itemprop="givenName"><img class=\'.*? logo_auteur .*?\' src="(.*?)"'
regex = r'<h1 itemprop="givenName">[\n]{0,}<img class=\'.*? logo_auteur .*?\' src="(.*?)"'
matches = re.search(regex, r.text)
if matches:
avatar = "{group}".format(group = matches.group(1))
Expand Down

0 comments on commit de4e925

Please sign in to comment.