Skip to content

Instantly share code, notes, and snippets.

@ssharker21
Created February 12, 2022 22:33
Show Gist options
  • Save ssharker21/7d0c2bf6a75b3011818c199b046d703a to your computer and use it in GitHub Desktop.
Save ssharker21/7d0c2bf6a75b3011818c199b046d703a to your computer and use it in GitHub Desktop.
Reddit Username Scraper
import asyncio
import aiohttp
# This program was created by jpark. It scrapes reddit for valid accounts if one already knows the username besides numbers at the end.
# Swap the characters inside the quotation marks for the variable s.
# Inside the quotation marks, type the part of the username that you already know (letters only). For the value of the number inside the string (i + _),
# Set the starting number for this scraper.
async def main():
async with aiohttp.ClientSession() as session:
for i in range(1000):
s = "account" + str(i + 100)
if i % 100 == 0:
print("On", i)
async with session.get("https://old.reddit.com/u/" + s) as resp:
if resp.status != 404:
print(s)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment