voussoir / reddit Goto Github PK
View Code? Open in Web Editor NEWA collection of reddit bots and utilities
License: BSD 3-Clause "New" or "Revised" License
A collection of reddit bots and utilities
License: BSD 3-Clause "New" or "Revised" License
I'm fairly new to using GitHub, so I didn't know where else to put this.
I would like to change the ReplyBot to only reply to people in the KEYAUTHORS section as opposed to blacklisting them. How would I go about doing this?
Hi, I see u did alot of work with all ur bots. It's little bit hard for me to find trough all, so if u can point me is there any reddit poster bot ?
What I mean is to pick up some source like xml, rss feed, json , and post from it ?
Peace,
https://github.com/voussoir/reddit/blob/master/ReplyBot/replybot.py#L82
Hi
Instead of checking all are not equal, you can check any are equal. It should be more understandable then.
if KEYAUTHORS != [] and all(auth.lower() != pauthor for auth in KEYAUTHORS):
# This post was not made by a keyauthor
continue
like
not any(auth.lower() == pauthor for auth in KEYAUTHORS)
IMPORTANT
You also need to .lower()
on the RHS as follows
not any(auth.lower() == pauthor.lower() for auth in KEYAUTHORS)
as reddit returns in caps sometimes.
Hello,
first of all, thank you for sharing your code, it has helped me a lot to build my own reddit bot.
https://github.com/voussoir/reddit/blob/master/Prawtimestamps/timesearch.py#L307
Now on the issue I've found, I've taken the get_all_posts() function to use it in my own code and I've noticed that when too few results are found, the lower variable gets assigned the value of the upper, when it should stay the same and recheck with a higher upper limit.
If the first if is true, then the second is false and the code inside else gets executed, changing the value of lower, when it should stay the same.
if itemsfound < 75:
...
if itemsfound > 99:
...
else:
lower = upper
...
Here's the correction I've applied:
if (itemsfound < 75):
print('Too few results, increasing interval', end='')
diff = 2 - (itemsfound / 75)
diff = min(MAXIMUM_EXPANSION_MULTIPLIER, diff)
interval = int(interval * diff)
elif (itemsfound > 99):
print('Too many results, reducing interval', end='')
interval = int(interval * (0.8 - (0.05 * toomany_inarow)))
toomany_inarow += 1
else:
lower = upper
toomany_inarow = max(0, toomany_inarow-1)
smartinsert(sql, cur, searchresults)
upper = lower + interval
I tried to find contact info for you, but came up empty, my apologies. This is not a problem with the repo.
I'm working on a project where the data you collected and released on subscriber counts over time has been extremely useful. I've got the sqlite databases from all of the releases, but I was wondering whether you might have more measurements lying around. I only need the subreddit name/id, subscriber count, and the date it was collected. Any other data, even if it's not complete, would be very helpful- a part of what I'm working on is looking at the patterns in time of the growth in communities by various metrics. To that end, having as many repeated measures for a subreddit as possible is helpful.
Another related question is whether you would be interested in the dataset I derive from your releases- I have a postgres table collating the subscriber counts over time from each release. I'd be happy to provide a sql dump or sqlite db file and with a little bit of work I could clean up my python code to generate that db given a set of dbs from your code, so that anyone with that data could reproduce it.
Thanks for making this available, it's been a huge help. If you'd prefer to discuss via email I can get you mine.
So, the function that's supposed to clean up the old values from the SQL database actually seems to be removing everything after 200. Meaning that the 201th post will receive an insane number of replies from the bot, with it posting once every 10 cycles.
Fixed this by modifying lines 79-82 in the bot file to comply with PRAW 4.
if text is not None:
newpost = r.subreddit(member[1]).submit(title, selftext=text, resubmit=True, send_replies=True)
if url is not None:
newpost = r.subreddit(member[1]).submit(title, url=url, resubmit=True, send_replies=True)
Just curious as to what license I should be putting the derived work under
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.