a1igator / repostcheckerbot Goto Github PK
View Code? Open in Web Editor NEWBot for checking reposts on reddit
License: MIT License
Bot for checking reposts on reddit
License: MIT License
The delete post at -2 votes feature seems to be broken, take a look:
https://www.reddit.com/r/ProgrammerHumor/comments/brpnwx/pretty_sure_those_are_node_modules/eofk07p?utm_source=share&utm_medium=web2x
Also might want to look at implementing something for more accurate detection
In your last commit (49469f8) you might have missed this loop
The applied fix to add a sleep will solve the immediate issue. The proper way to handle tasks is to use a task/event scheduler (https://docs.python.org/3/library/sched.html#). If you want to repeatedly run them make sure the task reschedules itself. This way you have more control over, can cancel it at any time, and still execute it even if an exception is thrown in the function.
A second improvement you can implement, if you want t really clean code, do not run the delete task in a fixed delay loop but rather just as necessary. You can retrieve the oldest/newest time in the sql query and compute the next time a deletion operation is necessary and schedule the appropriate task right away.
If sqllite for py isn't entirely different than every other db lib I have worked with:
We can reuse the connection, and it definitely should be closed once we are done with it. Closing the cursor is NOT! enough and you'll eventually run out of allowed connections we can establish
Hello,
As I will be making the bot public and very easy to add into any subreddit, I require for it to be able to handle 1000s of posts a minute, and it is just not fast enough for that yet. I have exhausted my knowledge of efficiency in Python, sqlite, and video and image hashing.
I would very much appreciate it if you may help me make the code more efficient in any of those areas. I believe the sqlite implementation is the area that could be improved the most due to the amount of statements that I have.
Most of the slow parts of the code are in database.py . The set up has been explained in the readme. Please make a comment if you are interested or have any questions/problems or even if you believe the code is as efficient as it can be.
Thanks for reading!
If not, you can check out https://github.com/harrisbegca/GeneralReposti and perhaps we can merge the two
I would like to add some documentation on how new contributors can test out the bot while they work on it.
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.