Coder Social home page Coder Social logo

Comments (16)

NoahSee avatar NoahSee commented on June 11, 2024

I cant really do a pull request because, ive used mongodb as the database.

from sneakpeek.

fterh avatar fterh commented on June 11, 2024

Hi, thanks for your effort! Could you quickly walk us through the main enhancements you made?

from sneakpeek.

NoahSee avatar NoahSee commented on June 11, 2024

I have made the functions in main.py do returns rather than call other functions so that it reads more easily.

  1. 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.

  2. 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()

  1. 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.

  2. Im currently looking into deploying it on AWS Lambda, but it has a bunch of issues with the external libraries.

  3. You can easily implement the logging function im using if you need it.

from sneakpeek.

NoahSee avatar NoahSee commented on June 11, 2024

Update: code is operational on lambda.

from sneakpeek.

fterh avatar fterh commented on June 11, 2024

@NoahSee Hi, are you running /u/AngryAngryCat?

from sneakpeek.

NoahSee avatar NoahSee commented on June 11, 2024

from sneakpeek.

fterh avatar fterh commented on June 11, 2024

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.

fterh avatar fterh commented on June 11, 2024

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.

NoahSee avatar NoahSee commented on June 11, 2024

from sneakpeek.

NoahSee avatar NoahSee commented on June 11, 2024

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.

fterh avatar fterh commented on June 11, 2024

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.

NoahSee avatar NoahSee commented on June 11, 2024

Cool. Let me know if you have any questions.

from sneakpeek.

xlanor avatar xlanor commented on June 11, 2024

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.

yleong avatar yleong commented on June 11, 2024

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.

NoahSee avatar NoahSee commented on June 11, 2024

I havent added a licence. You can use whatever you need since most of the code is yours to begin with.

from sneakpeek.

NoahSee avatar NoahSee commented on June 11, 2024

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)

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.