0

I've been looking into the Stack Exchange API, and thinking of building a bot.

I often see posts by new users that have poor spelling and grammar. I figure that a bot can easily do the job of fixing this up. I know it's not the most useful way to help out, but it can't hurt?

So my question is, would it be okay to build a bot like this?

Also, how often would it be acceptable for the bot to edit posts? As in, how many times per minute, or second?

  • Rate limits are spelled out in the API Documentation – Andy Oct 20 '17 at 4:08
  • @Andy Ok great, what about the main part of the question? – Luke Fisk-Lennon Oct 20 '17 at 4:12
  • What is your bot going to do when it hits the various non-English sites? those that use MathJax? those with many users from countries applying English English instead of USA English (or vice versa)? those that have questions specifically quoting or using non-standard English phrases or terminology? "[I]t's not the most useful way to help out, but it can't hurt?" One of these statements is true and one of them is false. – Nij Oct 20 '17 at 5:37
  • Your bot would need to accept British and American spelling, too. – ale Oct 20 '17 at 14:48
  • @ale I think I'm going to skip spell checking, because it's too hard to detect the context. In Stack Overflow in particular, a post will contain references to programming concepts which won't be in the dictionary. – Luke Fisk-Lennon Oct 20 '17 at 22:01
3

I've been looking into the Stack Exchange API, and thinking of building a bot.

That is awesome! Bots are very popular programming assignments (either voluntary or mandatory).

I often see posts by new users that have poor spelling and grammar.

Yes, not all users have English as their first language and we're not all Peter Mortensen.

I figure that a bot can easily do the job of fixing this up

If you have come to the conclusion that the API offers end-points for reading a post and making an edit, you're right. However, language and specially grammar and spelling, is a complex matter as it often needs context to be able to correct all issues.

I do not think that falls into the easy category. Keep in mind that code-blocks and things like citations should be left untouched. Not all posts might use the same markdown for that, causing troubles to make the right decision, either for users or bots...

I know it's not the most useful way to help out, but it can't hurt?

Fixing grammar and spelling is useful and encouraged.
You should read How does editing work? to familiarize yourself and your bot with the basic rules of editing, among others.
It can hurt if you only fixes a few things and not the whole post. All editors, including you (and your bot) should aim for fixing a post 100% so that no other user would feel the need to edit it again. This is assuming your bot is not polishing a turd.
If you fail that it does hurt. Their might be consequences as making useless, low quality edits is considered abuse. Users get suspended for that. Your bot would have to understand and comply with How does editing work

So my question is, would it be okay to build a bot like this?

It is okay to make such bot as long as you make sure its logic will beat the Turing test. That is, the edits made by your bot would be recognized by the community as if they are made by a human. If you can't come near that goal, your bot will not be okay.

Also, how often would it be acceptable for the bot to edit posts? As in, how many times per minute, or second?

That is laid out in the throttling guide:

  • not more than 30 requests a second per single IP
  • maximum 10,000 calls per day (with an access_token)
  • honor the dynamic throttle given in the backoff parameter

Keep in mind that editing a post bumps it on the active tab. Enough users keep an eye on that tab. Trying to edit a lot of posts as quickly as possible might not win you the popularity prize. Again, speed is not the biggest challenge here...

  • Great, that is very helpful. I can see what you mean about the task being tricky, especially considering markdown. I would test it outside the network first (for example, locally with test post content), and start out editing posts slowly. Once I'm confident, I would have it going as fast as possible (either the throttling limit, or whatever my server can handle). – Luke Fisk-Lennon Oct 20 '17 at 7:01
  • @iONinja Rene forgot to mention that you should also not be editing posts that are unsalvageable. If a post is still going to be an awful post after your edit, then you're not helping anyone by fixing a spelling mistake in it. There are also other things to keep in mind, which you should spend some time reading through in the editing guidelines in the help center and the FAQ. You should be intimately familiar with the rules and guidelines of editing if you plan to do something like this. – Servy Oct 20 '17 at 13:54
  • @Servy between us we can list plenty of reasons why building said bot is a major undertaking. I added some extra links to editing guidance. – rene Oct 20 '17 at 14:21
  • 1
    @rene I mostly commented because iO Ninja seems to think the problems you listed were manageable problems, based on their comment. I know that you could go on listing more. – Servy Oct 20 '17 at 14:22
  • 2
    @Servy we share the concern then... – rene Oct 20 '17 at 14:30
  • rene and @Servy Don't worry, I'm not going to launch it without checking all the guidelines. If I can't do it, then I just won't launch the bot. – Luke Fisk-Lennon Oct 20 '17 at 22:02
  • @iONinja If you were actually able to write a bot smart enough to intelligently correct spelling/grammar, based on context, correct formatting issues, not improperly change the meaning of the post, etc. then you'd have something that would be worth many, many millions of dollars to major software companies (like, say, and word editor, or Google, or...well...anyone). Using it to just edit posts on SO would be quite the waste, assuming you actually solve those problems (that have thus far gone largely unsolved by some of the best programming minds for many decades). – Servy Oct 21 '17 at 13:56
  • @Servy, I actually can't think of a way to solve the spelling problem, especially for SO. The are new technologies and libraries being made all the time, and it would be virtually impossible to keep a database of all these terms. Well it's possible, but I don't think I'm going to try :P. Grammar on the other hand will be challenging, but overall achievable I think. – Luke Fisk-Lennon Oct 21 '17 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .