RE: Follow Friday: Easy come...
You are viewing a single comment's thread:
If you run into any issues with the aiohivebot lib, or are missing things not (high) on my priorities list, please let me know. I noticed you work in jupyter notebook. I use jupyter a lot for data engineering and asyncio a lot for stuff that needs to be runnng 24/7, but never the combination of the two. I know it should (now) be possible, but I've never tried. If you run into any issues using the lib from jupyter, create an issue and I'll look into it asap.
Unrelated, regarding your bot, did you consider using fuzzywuzzy? I think it might be of use:
from fuzzywuzzy import fuzz
samples = ['proofofbrian', 'profofbrain', 'profofbrian', 'prooffbrain',
'poofofbrain', 'proofofbran', 'roofofbrain', 'proofofbain',
'prooofofbrain', 'proofofbrin', 'proofoofbrain', 'proofofbrai',
'prufofbrain', 'proofofbrane', 'proofofrain']
distances = {x: fuzz.ratio(x, "proofofbrain") for x in samples}
print(json.dumps(distances, indent=2))
{
"proofofbrian": 92,
"profofbrain": 96,
"profofbrian": 87,
"prooffbrain": 96,
"poofofbrain": 96,
"proofofbran": 96,
"roofofbrain": 96,
"proofofbain": 96,
"prooofofbrain": 96,
"proofofbrin": 96,
"proofoofbrain": 96,
"proofofbrai": 96,
"prufofbrain": 87,
"proofofbrane": 92,
"proofofrain": 96
}
A little aiohivebot script.
import asyncio
import json
from fuzzywuzzy import fuzz
from aiohivebot import BaseBot
class ProofOfBrainBot(BaseBot):
"""Example of an aiohivebot python bot without real utility"""
def __init__(self):
super().__init__()
async def comment_operation(self, body, timestamp):
if "author" in body and "json_metadata" in body:
author = body["author"]
try:
meta = json.loads(body["json_metadata"])
except Exception:
meta = {}
if "tags" in meta:
for tag in meta["tags"]:
ratio = fuzz.ratio(tag, "proofofbrain")
if ratio > 40 and tag != "proofofbrain":
print(timestamp, author, "used tag", tag, "ratio is", ratio)
mybot = ProofOfBrainBot()
loop = asyncio.get_event_loop()
loop.run_until_complete(mybot.run())
If you let it run for a day or so, maybe change it to write to a file and flush, you should get an idea of a decent ratio and if fuzzywuzzy is good enough to add to your bot.
I already saw 40 is way too low (it catches photography m orientation (43), and onboarding (45) and verifyyourbrain (59).
Here is 10 minutes of running the script:
2023-11-12 12:44:36 maulia12 used tag photography ratio is 43
2023-11-12 12:44:51 palomap3 used tag orientation ratio is 43
2023-11-12 12:44:51 palomap3 used tag onboarding ratio is 45
2023-11-12 12:47:18 furkanmamplam used tag photography ratio is 43
2023-11-12 12:47:27 naymhapz used tag orientation ratio is 43
2023-11-12 12:47:27 naymhapz used tag onboarding ratio is 45
2023-11-12 12:48:57 papilloncharity used tag verifyyourbrain ratio is 59
2023-11-12 12:49:09 usdt.p2p used tag photography ratio is 43
2023-11-12 12:49:48 gorayii used tag photography ratio is 43
2023-11-12 12:50:06 hiveredcarpet used tag fashion ratio is 42
2023-11-12 12:51:30 dsc-r2cornell used tag photography ratio is 43
2023-11-12 12:51:39 fizz0 used tag photography ratio is 43
2023-11-12 12:51:39 dsc-r2cornell used tag photography ratio is 43
2023-11-12 12:51:54 rafzat used tag cooking ratio is 42
2023-11-12 12:51:54 rafzat used tag photography ratio is 43
2023-11-12 12:51:57 palomap3 used tag photography ratio is 43
2023-11-12 12:52:39 yubaibai6 used tag photography ratio is 43
2023-11-12 12:52:39 teamukraine used tag ukraine ratio is 42
2023-11-12 12:53:54 manuvert used tag photography ratio is 43
2023-11-12 12:54:12 jrobe used tag personallife ratio is 42
2023-11-12 12:54:12 tarpanpaul used tag proposal ratio is 50
2023-11-12 12:54:18 roninrelax used tag photography ratio is 43
2023-11-12 12:54:27 rafzat used tag drawing ratio is 42
2023-11-12 12:54:27 rafzat used tag photography ratio is 43
2023-11-12 12:54:27 rafzat used tag pendrawing ratio is 45
2023-11-12 12:55:03 tarpanpaul used tag proposal ratio is 50
I'll look into these things. I generated a list of common mis-spellings by running some queries, but I have not used that sort of tool. My script is just a bit of fun, but it finds the odd case. It only notifies each person once, but has found over 700.
Thanks
!BEER
View or trade
BEER
.Hey @pibara, here is a little bit of
BEER
from @steevc for you. Enjoy it!We love your support by voting @detlev.witness on HIVE .