Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the total_points method #2

Merged
merged 1 commit into from Dec 20, 2018
Merged

Change the total_points method #2

merged 1 commit into from Dec 20, 2018

Conversation

CyrilleFranchet
Copy link
Contributor

Hi,

The total_points is now incorrect. I'm suspecting Root-Me to have changed something.
I used another method where I add all points to get the correct total_points value.

Not sure you use it anymore btw.

Copy link
Owner

@mpgn mpgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Nice catch :)

Can you check with this code ?

r = requests.get('https://www.root-me.org/fr/Communaute/Classement/')
regex = r'<td><a href=".*" title=".*">([0-9]+)</a></td>'
matches = re.search(regex, r.text)
if matches:
       data['total_points'] = "{group}".format(group = matches.group(1))

This solution avoid the sum part

@@ -73,11 +73,11 @@ def update():
print("[+] Starting Update generic information")

# get generic data
r = requests.get('https://www.root-me.org/fr/Communaute/Classement/')
regex = r'<a href=".*?>([0-9]+)</a>'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check with :

r'</a>'<td><a href=".*" title=".*">([0-9]+)</a></td>'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where you can find the total_points value in this page to be honest.
I'm testing with Chrome and don't see anything.

I think you just catch the score of the number one in the scoreboard, don't you?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a poor solution I have to admit ^^ Your solution is better 👍 PR accepted

@mpgn mpgn merged commit 267195a into mpgn:master Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants