alexames / DeltaBot

GNU General Public License v3.0
65 stars 18 forks source link

Formatting for deltas column in leaderboard #63

Closed projectdelphai closed 10 years ago

projectdelphai commented 10 years ago

This is hopefully a fix for #62. It's my first pull request to this project and I didn't really have a way to test it that I knew of, so let me know if I screwed anything up. Thanks!

amorde commented 10 years ago

Hey thanks for the pull request! And welcome.

Quick question - are you parsing the user's wiki page to get their total delta count? If you are, a much easier way to get the total is to just look at their current flair text.

Something like this:

flair_text = self.subreddit.get_flair(topscores[i]['user']) # ex "20∆"
total_deltas = int(flair[:-1]) # remove the delta

If I misunderstood your code, then ignore this!

Snorrrlax commented 10 years ago

Yeah, the user wiki pages are often inaccurate due to various bugs. If you're using flair text then it's all good.

Snorrrlax commented 10 years ago

And thank you for doing this :)

projectdelphai commented 10 years ago

Alright, so I changed the code to reflect that flair text. You're right in that it makes much more sense this way.