]> jfr.im git - erebus.git/commitdiff
update team
authorJohn Runyon <redacted>
Thu, 5 Jan 2023 19:15:05 +0000 (13:15 -0600)
committerJohn Runyon <redacted>
Thu, 5 Jan 2023 19:18:53 +0000 (13:18 -0600)
LICENSE
modules/coins.py [deleted file]
modules/urls.py

diff --git a/LICENSE b/LICENSE
index 11966cddbece61934918812b8452599b329c5fa7..e22e19cb20c20a356d175fc4bc81aeec659a3ca3 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Team: Zonidjan and Conny Sjoblom
+Author: John Runyon <https://jfr.im>
 
 This is free and unencumbered software released into the public domain.
 
diff --git a/modules/coins.py b/modules/coins.py
deleted file mode 100644 (file)
index 8653667..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-# Erebus IRC bot - Author: Erebus Team
-# vim: fileencoding=utf-8
-# simple coin module
-# This file is released into the public domain; see http://unlicense.org/
-
-# module info
-modinfo = {
-       'author': 'Erebus Team',
-       'license': 'public domain',
-       'compatible': [0],
-       'depends': [],
-       'softdeps': [],
-}
-
-# preamble
-import modlib
-lib = modlib.modlib(__name__)
-modstart = lib.modstart
-modstop = lib.modstop
-
-# module code
-import re
-import json
-import requests
-
-coin_regex = (
-       re.compile(r'([0-9.,\s]+)\s(btc|bitcoin|doge|dogecoin|ltc|litecoin)'),
-)
-
-cur_regex = (
-       re.compile(r'([0-9.,\s]+)\s([a-zA-Z]{3})\sin\s([a-zA-Z]{3})'),
-)
-
-url = 'http://www.cryptocoincharts.info/v2/api/tradingPairs'
-
-def get_coin_price(pairs):
-       response = requests.post(url, data = {'pairs': pairs})
-       return json.loads(response.text)
-
-@lib.hook()
-def btc(bot, user, chan, realtarget, *args):
-       if len(args) > 0:
-               try:
-                       response = get_coin_price('btc_eur')
-                       price = str(float(response[0]['price']) * float(args[0]))
-                       bot.msg(chan, "%s BTC = %s EUR" % (args[0], price))
-               except:
-                       bot.msg(chan, "Invalid amount.")
-       else:
-               response = get_coin_price('btc_eur')
-               price = str(float(response[0]['price']))
-               bot.msg(chan, "1 BTC = %s EUR" % price)
-
-@lib.hook()
-def doge(bot, user, chan, realtarget, *args):
-       if len(args) > 0:
-               try:
-                       doge_btc = get_coin_price('doge_btc')
-                       btc_eur = get_coin_price('btc_eur')
-                       price = str(float(doge_btc[0]['price']) * float(btc_eur[0]['price']) * float(args[0]))
-                       bot.msg(chan, "%s DOGE = %s EUR" % (args[0], price))
-               except:
-                       bot.msg(chan, "Invalid amount.")
-       else:
-               doge_btc = get_coin_price('doge_btc')
-               btc_eur = get_coin_price('btc_eur')
-               price = str(float(doge_btc[0]['price']) * float(btc_eur[0]['price']))
-               bot.msg(chan, "1 DOGE = %s EUR" % price)
-
-@lib.hook()
-def ltc(bot, user, chan, realtarget, *args):
-       if len(args) > 0:
-               try:
-                       ltc_btc = get_coin_price('ltc_btc')
-                       btc_eur = get_coin_price('btc_eur')
-                       price = str(float(ltc_btc[0]['price']) * float(btc_eur[0]['price']) * float(args[0]))
-                       bot.msg(chan, "%s LTC = %s EUR" % (args[0], price))
-               except:
-                       bot.msg(chan, "Invalid amount.")
-       else:
-               ltc_btc = get_coin_price('ltc_btc')
-               btc_eur = get_coin_price('btc_eur')
-               price = str(float(ltc_btc[0]['price']) * float(btc_eur[0]['price']))
-               bot.msg(chan, "1 LTC = %s EUR" % price)
-
-@lib.hooknum("PRIVMSG")
-def privmsg_hook(bot, line):
-
-       try:
-               linetx = line.split(None, 3)[3][1:]
-       except IndexError:
-               linetx = ''
-
-       chan = line.split()[2]
-
-       if 'in' in line:
-               for r in cur_regex:
-                       for a, f, t in r.findall(linetx):
-
-                               # https://www.google.com/finance/converter?a=1.2&from=USD&to=EUR
-
-                               a = a.replace(",", ".")
-                               a = a.replace(" ", "")
-
-       if 'btc' in line or 'bitcoin' in line or 'doge' in line or 'dogecoin' in line:
-               for r in coin_regex:
-                       for amount, coin in r.findall(linetx):
-                               amount = amount.replace(",", ".")
-                               amount = amount.replace(" ", "")
-                               if 'btc' in coin or 'bitcoin' in coin:
-                                       try:
-                                               response = get_coin_price('btc_eur')
-                                               price = str(float(response[0]['price']) * float(amount))
-                                               bot.msg(chan, "%s BTC = %s EUR" % (amount, price))
-                                       except:
-                                               pass
-
-                               if 'ltc' in coin or 'litecoin' in coin:
-                                       pass    # Add LTC
-
-                               if 'doge' in coin or 'dogecoin' in coin:
-                                       try:
-                                               doge_btc = get_coin_price('doge_btc')
-                                               btc_eur = get_coin_price('btc_eur')
-                                               price = str(float(doge_btc[0]['price']) * float(btc_eur[0]['price']) * float(amount))
-                                               bot.msg(chan, "%s DOGE = %s EUR" % (amount, price))
-                                       except:
-                                               bot.msg(chan, "Invalid amount.")
index 901d191c3aa78f8f77fd187c3b26b8b9fcd1b124..93615911226ffc94c7cd09712603497941d43806 100644 (file)
@@ -1,4 +1,4 @@
-# Erebus IRC bot - Author: Erebus Team
+# Erebus IRC bot - Author: Conny Sjoblom
 # vim: fileencoding=utf-8
 # URL Checker
 # This file is released into the public domain; see http://unlicense.org/