Giter Club home page Giter Club logo

Comments (4)

shrink avatar shrink commented on July 30, 2024 2

I'd argue because it's not possible to do this automatically with any reliability that trying to do it automatically will create a very confusing user experience -- "why hasn't the bot updated the conversion when I edited my comment but it did for another comment I saw? How do I make it update?".

The problem of edited comments is meaningful enough to try and solve, but I don't think it's a big enough problem to justify the introduction of a solution that has so many caveats.

Given the bot already has support for receiving Private Messages which trigger an action, perhaps an additional trigger for updating a reply would be the correct approach as it would provide a consistent experience for all users. A "refresh reply" link in the footer of each reply to a new message where the subject is "refresh" and the body is the comment ID that any user can send to the bot when they notice a mismatched comment/conversion.

I would like to try implementing that solution if there aren't any problems I've missed -- is rate limiting important to prevent malicious users from crashing the bot by sending lots of refresh requests? Does the reddit API have limits that will prevent the bot from updating comments?

from metric_units_reddit_bot.

cannawen avatar cannawen commented on July 30, 2024 1

Given the limitations of the reddit API, I agree, I don't think we can come up with a foolproof automated solution. Perhaps a human-solution is the way to go. I like the idea of a link that says "refresh"! I feel like we might have to cut down on number of links in the footer though (maybe source and hacktoberfest can go) ... but I digress, that's a completely different issue.

It'd be awesome if you could pick up this issue @citricsquid! Assigning to you :)

So, from my past research: the reddit API limits bot scripts to ~100 requests per minute, and it allows for periods of "burstiness" of up to 200 requests per minute. Right now the bot is doing a maximum of maybe ~10 requests per minute (since polling for new comments is "free", from an unauthenticated endpoint). I don't forsee API limits being an issue for a delete link

BUT if you do go over the limit, reddit puts your bot on "cool down" for 10 minutes where it ignores your request. If your bot goes rogue (consistently going over the rate limit) reddit might start permanently rejecting your user agent string to prevent abuse. It's easy to change its user agent string though, so you can release the next version of your bot (with the rate limit problem fixed, hopefully) and reddit will start accepting your requests again

from metric_units_reddit_bot.

nalinbhardwaj avatar nalinbhardwaj commented on July 30, 2024

Simplest solution might be to re-check last, say 100 comments, so that would probably make sure any edited comments within 10 minutes of creation or so have a correct response.

from metric_units_reddit_bot.

cannawen avatar cannawen commented on July 30, 2024

The "edit" functionality is working now, pretty sweet! I also give it a little "edit" prefix.

There was a messed up thing in the base get call that unwrapped responses & caused problems (heh, my bad).

from metric_units_reddit_bot.

Related Issues (20)

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.