Created
July 12, 2020 05:48
-
-
Save demodude4u/e8bbd7e639eefda73e11aa6c83148c7a 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 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