Skip to content

Instantly share code, notes, and snippets.

@achow101
Created April 24, 2018 19:09
Show Gist options
  • Save achow101/e9bfe8e65da2cb863f80a81511b4b79f to your computer and use it in GitHub Desktop.
Save achow101/e9bfe8e65da2cb863f80a81511b4b79f to your computer and use it in GitHub Desktop.
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