You are viewing a single comment's thread from:

RE: [deardiary] 1 day out of 364 does not make for a goodyear , dear

in #ulog6 years ago

Thanks ! @checky doesn't have any post on its account because I felt like they would have been useless, there is only so much stats you can make with that kind of bot. It's funny you mention spellchecking bots because @grammarnazi is what inspired me to make this bot ! :P

Sort:  

i'm not too fond of grammarnazi ,its a good idea but not for people who like to use language in a free way, sometimes spelling mistakes are set on purpose to set (or in) a certain mood , as a pun or a sneer, a bot like that can ofcourse not handle that, but i have the feeling he's gone ...

I like the idea too and I frankly find it quite impressive but yeah, it can be annoying. Most steemians feel the same way, making it use an opt-in system would have been a better idea imo. He's not gone though, probably ignoring your posts, not sure if it has an opt-out system built in.

i see yours has one and yea i think thats a mighty fine idea too, you can't force these things on people, that magic 8ball thing responds to every answer i give on musing and post on my blag. I dont bother but its been downvoted so much it has a rep of like 8 or something and it probably never gets anything. I'm surprised it keeps running, its like someone forgot to turn it off.

i dabble a bit in scripting myself but im not confident enough to run a full time bot with an unlocked wallet on a 24/7 machine. Besides , mine (@ubasti and the other two) would need automated transactions too and since i dont do python error checking and transaction validation would require actual thinking and work lol
its simple enough using steempy but sometimes things lag out, which in most cases afaics would require re-running the whole script from the start, in which case non-failed transactions would have to be left out :|

that's the tricky bit, id need to have a specific error message i can intercept to check for after every transaction in order to do that since otherwise the posts voted on or acounts that get sbd sent to would be removed from the flatfile on every cycle of the loop (which means re-starting the script means they're no longer there :p) and checking it on account history takes minutes sometimes before it can be read

i assume you parse a post body for "at"name , put that in an array or something but then what ? theres over a million accounts ? do you keep a local file with all names in it?

@checky is written in JavaScript using steemjs but I'm sure the same overall logic applies to Python and steempy. Your situation is way trickier than mine though since you actually deal with upvotes and money transfers, I feel like you definitely should do error checking! It's not fun but it's quite essential, especially when money is involved. I don't know how complicated it is in Python though since that's a language I still have to learn, in JS it's quite easy to check for errors.

The version currently running doesn't actually parse the post's body but makes use of the users array added to the post's json_metadata by some apps. The next version though will parse the body to find mentions, I've been testing it for two days now and I feel like it should be ready to be deployed by tomorrow. Mentions found in the post get filtered to make sure that I get the least not Steem related mentions. For example, mentions with a social network related word close to them are filtered out, mentions that end with popular domain extensions like @website.com are filtered out too (because some people use the '@' character to say 'at'), etc.... As for filtering out all existing users, it indeed checks the mentions against a JSON file that contains a user object for each user it encountered while streaming operations, the file fills up pretty quickly. For example, the user object associated to your username is the following (on my computer).

{
    "mode": "regular",
    "ignored": [],
    "delay": 0,
    "occurrences": 0,
    "mentioned": []
}

There may be over a million accounts but most of them are inactive so since they don't make any operation, they aren't added to the file. Last time I checked, the JSON file on my computer had about 70k usernames but the one used by the bot on the server probably has way more than that. If it can't find the username in the file, it uses the Steem API to lookup the account name (lookup_account_names) and if that API returns null for the account, it means that it doesn't exist and the bot broadcasts a comment. If it returns some data on the account, the account exists so it adds it to the JSON file with the default settings. "occurrences" and "mentioned" don't exist for the version currently running, they are both used for mention correcting on the next version of the bot. I'm using Peter Norvig's spelling corrector algorithm which is a bit of a brute force approach but it works pretty well. "occurrences" is the number of times you were mentioned and "mentioned" is an array of users you mentioned at least once. I may drop that array one day if it makes the file too heavy.

Loading...