Giter Club home page Giter Club logo

reddit-comment-bot's People

Contributors

yashar1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

reddit-comment-bot's Issues

Add multy account!

This great Bot 😃
can you add multy account feature ?

this will make powerfull ☺️

ImportError: No module named 'praw'

Hi,

I doubt this is an issue with your code but perhaps you could help since I can't seem to find anything on Google.

When testing the code in IDLE it keeps coming back with this:

Traceback (most recent call last):
File "C:\Users\thati\OneDrive\Desktop\comment.py", line 1, in
import praw
ImportError: No module named 'praw'

But I have praw installed. I've checked using help('modules') and it lists praw. I even installed using pip3. ot sure what is going on. This is a fresh install on a new PC and I haven't used python since college but it can't be that hard to install a module with the new python.

I also had to change all the "wording" to ("wording") to fix thaat syntax error and I'm not sure if that was a mistake. Again,. haven't used Python since college, which is about 9 years now.

So, minus the module issue I've made the appropriate changes, and changes I think might work (the quotes). I've changed my personal info to PERSONAL where I believe I'm supposed to add my info. Here is what I have so far:

import praw
import config
import time
import os

def bot_login():
print ("Logging in")
r = praw.Reddit(username = config.PERSONAL,
password = config.PERSONAL,
client_id = config.PERSONAL,
client_secret = config.PERSONAL,
user_agent = "The Reddit Commenter v1.0")
print ("Logged in!")

return r

def run_bot(r, comments_replied_to):
print ("Searching last 1,000 comments")

for comment in r.subreddit('test').comments(limit=1000):
	if "You" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
		print ("String with \"You\" found in comment ") + comment.id
		comment.reply("Congrats, you are smarter than PERSONAL")
		print ("Replied to comment ") + comment.id

		comments_replied_to.append(comment.id)

		with open ("comments_replied_to.txt", "a") as f:
			f.write(comment.id + "\n")

print ("Search Completed.")

print (comments_replied_to)

print ("Sleeping for 10 seconds...")
#Sleep for 10 seconds...		
time.sleep(10)

def get_saved_comments():
if not os.path.isfile("comments_replied_to.txt"):
comments_replied_to = []
else:
with open("comments_replied_to.txt", "r") as f:
comments_replied_to = f.read()
comments_replied_to = comments_replied_to.split("\n")
comments_replied_to = filter(None, comments_replied_to)

return comments_replied_to

r = bot_login()
comments_replied_to = get_saved_comments()
print (comments_replied_to)

while True:
run_bot(r, comments_replied_to)

How to scan for and reply with comments containing line breaks?

Hello,

I’d like to scan for comments including line breaks, such as:

“This is a 

comment”

And then reply with something like:

“Thank you

for your comment”

Is that possible with this bot? And is it as simple as putting in the appropriate “\n” - e.g. the reply would then be:

“Thank you\n\nfor your comment”

Would that work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.