From ea6ba7464c2ae7dfb95d24d6538880fbadee2444 Mon Sep 17 00:00:00 2001 From: svitvojimilioni Date: Wed, 7 Feb 2024 19:57:36 -0500 Subject: [PATCH 1/2] Dodao frontende za vise servisa - frontendi su u frontends.py fajlu - ima vise instanci da ne bi stalno slao na jednu, da nema centralizacije ;) --- functions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions.py b/functions.py index 6d5a17b..e1bc07e 100644 --- a/functions.py +++ b/functions.py @@ -1,13 +1,16 @@ import ollama import scraper_functions as sf +import random +from frontends import FRONTENDS def processmsg(msg, rcpt): - if "youtube.com/watch" in msg: - return msg.replace("youtube.com", "iv.datura.network") - elif msg.startswith("!"): + if msg.startswith("!"): return command(msg, "") elif "good bot" in msg: return "^_^" + for big_tech_site in FRONTENDS: + if big_tech_site in msg: + return "libre link: " + msg.replace(big_tech_site, random.choice(FRONTENDS[big_tech_site])) def command(msg, rcpt): if msg.startswith("!help"): From 305fc1405ab598b1ec0072ed6390b31cb9f78cb2 Mon Sep 17 00:00:00 2001 From: svitvojimilioni Date: Wed, 7 Feb 2024 19:57:36 -0500 Subject: [PATCH 2/2] Dodao frontende za vise servisa - frontendi su u frontends.py fajlu - ima vise instanci da ne bi stalno slao na jednu, da nema centralizacije ;) --- frontends.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 frontends.py diff --git a/frontends.py b/frontends.py new file mode 100644 index 0000000..a00021c --- /dev/null +++ b/frontends.py @@ -0,0 +1,11 @@ +FRONTENDS = { + "youtube.com/watch": ("iv.datura.network", "inv.tux.pizza"), + "medium.com" : ("scribe.rip", "sc.vern.cc", "m.opnxng.com"), + "stackoverflow.com": ("code.whatever.social", "ao.vern.cc", "overflow.smnz.de"), + "instagram.com": ("bibliogram.1d4.us", "bibliogram.froth.zone", "ig.opnxng.com", "proxigram.lunar.icu"), + "genius.com": ("dm.vern.cc", "dumb.lunar.icu", "dumb.esmailelbob.xyz"), + "reddit.com":("eu.safereddit.com", "l.opnxng.com", "libreddit.bus-hit.me"), + "www.imdb.com": ("libremdb.iket.me", "ld.vern.cc", "binge.whatever.social"), + "twitter.com": ("n.opnxng.com", "nitter.1d4.us", "nitter.adminforge.de"), + "wikipedia.com": ("wiki.adminforge.de", "wiki.froth.zone", "wikiless.esmailelbob.xyz") +}