Skip to content

Instantly share code, notes, and snippets.

@demodude4u
Created July 12, 2020 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demodude4u/e8bbd7e639eefda73e11aa6c83148c7a to your computer and use it in GitHub Desktop.
Save demodude4u/e8bbd7e639eefda73e11aa6c83148c7a to your computer and use it in GitHub Desktop.
import praw
from psaw import PushshiftAPI
import re
reddit = praw.Reddit(client_id="CLIENT_ID",client_secret="CLIENT_SECRET",user_agent="USER_AGENT",username="USERNAME",password="PASSWORD")
api = PushshiftAPI(reddit)
for comment in api.search_comments(author="BlueprintBot"):
for line in comment.body.splitlines():
if "bundly.io" in line:
comment.edit(re.sub(r"Blueprint Images .*:","Blueprint Images:",comment.body))
print(f"https://www.reddit.com/{comment.permalink}")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment