Created
April 24, 2018 19:09
-
-
Save achow101/e9bfe8e65da2cb863f80a81511b4b79f 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
import requests | |
import re | |
import operator | |
from bs4 import BeautifulSoup | |
r = requests.get('https://bitcointalk.org/modlog.php') | |
p = re.compile('member #\d+') | |
all_members = p.findall(r.text) | |
mem_dict = {} | |
for member in all_members: | |
if member not in mem_dict: | |
mem_dict[member] = 1 | |
else: | |
mem_dict[member] += 1 | |
sorted_mem = sorted(mem_dict.items(), key=operator.itemgetter(1)) | |
print(len(mem_dict)) | |
nums = re.compile('\d+') | |
for mem in sorted_mem: | |
print(mem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment