diff --git a/config/config.json.example b/config/config.json.example index b0ec36f..9a20f8b 100644 --- a/config/config.json.example +++ b/config/config.json.example @@ -49,6 +49,6 @@ "scoreboard": { "table_head": "\n\n| Rank | Username | Deltas |\n| :------: | ------ | :------: |", "table_leader_entry": "\n| **1** | **/u/%s** | [**%s**](/r/%s/wiki/user/%s \"Delta history.\") |", - "table_entry": "\n| %s | /u/%s | [%s](/r/%s/wiki/user/%s \"Delta history.\") |" + "table_entry": "\n| %s | /u/%s | %s ([%s](/r/%s/wiki/user/%s \"Delta history.\")) |" } } diff --git a/deltabot/deltabot.py b/deltabot/deltabot.py index 68f7b07..cf5f08f 100644 --- a/deltabot/deltabot.py +++ b/deltabot/deltabot.py @@ -585,8 +585,11 @@ def update_scoreboard(self): ] for i in range(1, 10): + flair_texts = self.subreddit.get_flair(top_scores[i]['user']) + total_deltas = int(flair_texts[:-1]) + table_entry = self.config.scoreboard['table_entry'] % ( - i + 1, top_scores[i]['user'], top_scores[i]['flair_text'], + i + 1, top_scores[i]['user'], top_scores[i]['flair_text'], total_deltas self.config.subreddit, top_scores[i]['user'] ) score_table.append(table_entry) @@ -621,7 +624,7 @@ def get_top_ten_scores_for_date(self,date): for user, value in scoreboard.iteritems(): score_list.append({ 'user': user, - 'flair_text': self.config.flair['point_text'] % value['score'] + 'flair_text': value['score'] }) score_list = sorted(score_list, key=flair_sorter) score_list.reverse()