Skip to content

Instantly share code, notes, and snippets.

@theblazehen
Created August 26, 2013 17:13
Show Gist options
  • Select an option

  • Save theblazehen/6343987 to your computer and use it in GitHub Desktop.

Select an option

Save theblazehen/6343987 to your computer and use it in GitHub Desktop.
Clever bot reddit
import praw
import random
import time
import cleverbot
import os
reddit = praw.Reddit(user_agent='insult bot')
reddit.login('Clever_Bot_Replies', 'pass')
mycb=cleverbot.Session()
while 1 :
all_unread = reddit.get_unread()
unreadlist = list(all_unread)
try:
unreadlist[0].upvote()
comment = unreadlist[0]
reply = mycb.Ask(str(comment))
unreadlist[0].reply(reply)
comment.mark_as_read()
commentlist[0].upvote()
except Exception as e:
print(e)
try :
comment = unreadlist[0]
comment.mark_as_unread()
except:
print("")
all_comments = reddit.get_comments('all')
commentlist = list(all_comments)
commentlist[0].upvote()
comment = commentlist[0]
reply = mycb.Ask(str(comment))
os.system("clear")
print(comment)
print(reply)
try:
commentlist[1].reply(reply)
except Exception as e:
print("Failed to comment")
print(e)
time.sleep(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment