mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-11-12 13:02:04 +01:00
25 lines
654 B
Python
25 lines
654 B
Python
|
|
||
|
#6y7LtOjoNEfe72g62kZfwtFHMWkQ8XsZvcQ8xZDe
|
||
|
|
||
|
import praw
|
||
|
|
||
|
outfile = open('users.html', 'w')
|
||
|
|
||
|
credentials = open('credentials', 'r')
|
||
|
client_id = credentials.readline().strip(' \t\n\r')
|
||
|
client_secret = credentials.readline().strip(' \t\n\r')
|
||
|
|
||
|
reddit = praw.Reddit(client_id=client_id, client_secret=client_secret, user_agent='atlas_bot')
|
||
|
|
||
|
users = set()
|
||
|
|
||
|
for submission in reddit.subreddit('placeAtlas').new(limit=1000):
|
||
|
users.add(submission.author.name)
|
||
|
|
||
|
users = list(users)
|
||
|
users = sorted(users, key=str.lower)
|
||
|
|
||
|
print(len(users))
|
||
|
|
||
|
for user in users:
|
||
|
outfile.write("\t\t\t\t\t<a href=\"https://reddit.com/user/"+user+"\" target=\"_blank\">"+user+"</a>\n")
|