aboutsummaryrefslogtreecommitdiffstats
path: root/archive_posts.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2019-01-07 20:03:02 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2019-01-07 20:03:02 +0000
commitcdecedef83a73ab8d1011f22e1549d6013897c13 (patch)
tree1fba64a306e196ce96e04a30b9cd64f2353933de /archive_posts.py
downloadSmallYTChannelBot-cdecedef83a73ab8d1011f22e1549d6013897c13.tar.gz
SmallYTChannelBot-cdecedef83a73ab8d1011f22e1549d6013897c13.zip
added YouTube API features
Diffstat (limited to 'archive_posts.py')
-rw-r--r--archive_posts.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/archive_posts.py b/archive_posts.py
new file mode 100644
index 0000000..a68feaf
--- /dev/null
+++ b/archive_posts.py
@@ -0,0 +1,25 @@
+import praw
+import database
+import login
+
+reddit = login.REDDIT
+
+subreddit = reddit.subreddit("jwnskanzkwktest")
+db = database.Database()
+
+comment_stream = subreddit.stream.comments(pause_after=-1)
+submission_stream = subreddit.stream.submissions(pause_after=-1)
+while True:
+ for comment in comment_stream:
+ if comment is None:
+ break
+ if not db.id_in_blacklist(comment.id):
+ print("archived: ", comment.id)
+ db.add_to_blacklist(comment.id)
+
+ for submission in submission_stream:
+ if submission is None:
+ break
+ if not db.id_in_blacklist(submission.id):
+ print("archived: ", submission.id)
+ db.add_to_blacklist(submission.id) \ No newline at end of file