Comments (16)
I cant really do a pull request because, ive used mongodb as the database.
from sneakpeek.
Hi, thanks for your effort! Could you quickly walk us through the main enhancements you made?
from sneakpeek.
I have made the functions in main.py do returns rather than call other functions so that it reads more easily.
-
In your code, main.py does not tell you the overall flow, because scan(subreddit) calls a function that calls yet another function. I made it such that submission.reply () can be seen on main.py. Hence you can see the whole flow on what the code is doing.
-
Ive used MongoDB Atlas because its much easier for me to run. Notice that it is cloud based and needs much less code to work. A collection in MongoDB is simply a list of dictionaries. Ive used a method to return the whole list to check through so it only needs to be read once each time main.py runs.
if any( submission_record['submission_id'] == submission.id for submission_record in submission_records):
does all the work of checking if the submission has already been processed, so you dont need to use qualify()
-
process_submission.py (WIP) should return a comment if url is valid or None if url is not valid. Im currently testing using straitstimes only.
-
Im currently looking into deploying it on AWS Lambda, but it has a bunch of issues with the external libraries.
-
You can easily implement the logging function im using if you need it.
from sneakpeek.
Update: code is operational on lambda.
from sneakpeek.
@NoahSee Hi, are you running /u/AngryAngryCat?
from sneakpeek.
from sneakpeek.
Can I confirm if you will be running it long-term? I understand that you're running it on a modified codebase (based off this one). I'm just not sure how we're going to coordinate future releases, since I (and the other collaborators) will be working on this repo in the future, and your repo isn't a fork off this so you can't do a git pull.
from sneakpeek.
Also, thanks for your breakdown of the changes you've made. I haven't had time to look into that in detail, but I'll definitely get back to that when my schedule clears up. :)
from sneakpeek.
from sneakpeek.
I have updated the handlers. Have a look.
https://github.com/NoahSee/reddit_commenter
You can coordinate the open sourcing on your repo. I will update the handlers on my repo every once a while. I dont think there needs to be 2 bots running in the long run. Im testing mine for now and ill delete duplicate posts on my end if I see any.
Are you interested in running my version of the code? It uses free tier AWS and mongodb and theres no system infrastructure to mange.
from sneakpeek.
I'd prefer to run on my codebase at the moment, although I'm definitely interested to see how I can further improve it once I have time to look at your changes :)
I'm also definitely interested to run on a platform like lambda so I don't have to manage infrastructure. I considered mongodb atlas, but I dropped it because I wanted to get my beta up and running as quickly as I can, and sqlite3 seemed robust enough. It does sound like a great milestone for a future release though!
from sneakpeek.
Cool. Let me know if you have any questions.
from sneakpeek.
For the bot I dont think you need to deploy it on atlas. I think running it off a local instance on your DO droplet might be more than sufficient.
from sneakpeek.
I agree that a DO droplet can more than handle this workload. But I like the idea of fn(url)
. That way anybody can call the code. Deploying on AWS can solve the uptime issues too.
However, since reddit_commenter
has no shared git history with sneakpeek
, any merge might have to be copied out-of-band. @NoahSee , what license are you releasing reddit_commenter
under?
from sneakpeek.
I havent added a licence. You can use whatever you need since most of the code is yours to begin with.
from sneakpeek.
Hi guys,
I will not be doing any more updates on my repo. It was a good project to do over the CNY break, I really wanted to try out your code and see how I could improve on it.
Also, my bot account got banned. lol
from sneakpeek.
Related Issues (17)
- Handle articles with comment.body longer than 10000 characters HOT 2
- cnalifestyle.channelnewsasia.com has title only (no body) HOT 2
- Program crashes after running for a few days HOT 10
- Ricemedia handler unable to handle links with tracking query HOT 2
- Incorrect article.text parsing (ricemedia.co) HOT 2
- Implement proper logging HOT 8
- Program still crashes HOT 12
- Program stops running after a while without error/exception
- Program does not resume running if scan() method throws
- Remove unused files and dependencies
- Warn when env var `SUBREDDIT` is not set
- Set up automated code review in deployment pipeline
- Refactor config options to environment variables
- Detect and handle premium Straitstimes articles HOT 5
- Special characters not escaped
- Today article has title only (no body) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sneakpeek.