Dynamic bot list.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m20s

This commit is contained in:
retoor 2024-12-19 13:02:24 +01:00
parent d06473f5cb
commit 7346ca6eaa
8 changed files with 12 additions and 26 deletions

View File

@ -1,5 +1,6 @@
ENV=./.venv/bin/activate ENV=./.venv/bin/activate
PYTHON=./.venv/bin/python PYTHON=./.venv/bin/python
BIN=./.venv/bin
all: ensure_env format build install test all: ensure_env format build install test
format: format:
@ -17,7 +18,7 @@ install:
$(PYTHON) -m pip install -e . $(PYTHON) -m pip install -e .
run: run:
$(PYTHON) -m ragnar.run $(BIN)/ragnar.run
test: test:
$(PYTHON) -m unittest ragnar.tests $(PYTHON) -m unittest ragnar.tests

View File

@ -14,6 +14,10 @@ Another one:
![Image generated by Buffon](buffon2.jpg) ![Image generated by Buffon](buffon2.jpg)
Third one, the legendary bot war of 2024 ended in peace.
![Image generated by Buffon](buffon3.jpg)
## How they work ## How they work
One process starts many bots. These bots look at new rants. One process starts many bots. These bots look at new rants.

BIN
buffon3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Binary file not shown.

View File

@ -13,5 +13,6 @@ src/ragnar/api.py
src/ragnar/bot.py src/ragnar/bot.py
src/ragnar/cache.py src/ragnar/cache.py
src/ragnar/cli.py src/ragnar/cli.py
src/ragnar/victoria.py
src/ragnar/tests/__init__.py src/ragnar/tests/__init__.py
src/ragnar/tests/bot.py src/ragnar/tests/bot.py

View File

@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor as Executor
from ragnar import log from ragnar import log
from ragnar.bot import Bot from ragnar.bot import Bot
from ragnar.victoria import vic
def parse_args(): def parse_args():
parser = argparse.ArgumentParser(description="Process username and password.") parser = argparse.ArgumentParser(description="Process username and password.")
@ -30,30 +30,7 @@ def bot_task(username, password):
def main(): def main():
args = parse_args() args = parse_args()
usernames = [ usernames = vic.get_friends()
# "no-spam1",
# "no-spam2",
# "no-spam3",
# "no-spam4",
# "no-spam",
"no-spam2353",
"no-spam2351",
"no-spam2350",
"no-spam2349",
"JamesMedina",
"MichelleWeeks",
"JaredRuiz",
"LoriMcgee",
"AmandaFloyd",
"tcpudp",
"JoseRodriguez",
"CaseyHernandez",
"ToddHarris",
"AnneRose",
"GregoryBowman",
"LeahVasquez",
"JamesMedina",
]
with Executor(len(usernames)) as executor: with Executor(len(usernames)) as executor:
for username in usernames: for username in usernames:

3
src/ragnar/victoria.py Normal file
View File

@ -0,0 +1,3 @@
from xmlrpc.client import ServerProxy
vic = ServerProxy("https://victoria.molodetz.nl/rpc")