Compare commits
4 Commits
aabb8e759d
...
77fcdad55d
Author | SHA1 | Date |
---|---|---|
root | 77fcdad55d | |
jw | 7db20d993d | |
lza_menace | 101ec90dbb | |
lalanza808 | c91ef2b935 |
24
network.py
24
network.py
|
@ -95,3 +95,27 @@ def solo(bot, trigger):
|
||||||
@sopel.module.commands('b2x')
|
@sopel.module.commands('b2x')
|
||||||
def b2x(bot, trigger):
|
def b2x(bot, trigger):
|
||||||
bot.say("Fuck off \\x")
|
bot.say("Fuck off \\x")
|
||||||
|
|
||||||
|
def get_pools(coin = 'monero'):
|
||||||
|
resp = requests.get("https://data.miningpoolstats.stream/data/time")
|
||||||
|
time = int(resp.text)
|
||||||
|
resp = requests.get("https://data.miningpoolstats.stream/data/{}.js?t={}".format(coin, time))
|
||||||
|
j = resp.json()
|
||||||
|
return j
|
||||||
|
@sopel.module.commands('miners')
|
||||||
|
def print_monero_miners_counter(bot, trigger):
|
||||||
|
pools = get_pools()
|
||||||
|
result = {
|
||||||
|
'website counter': pools['poolsminers'],
|
||||||
|
'website counter recalculated': sum([
|
||||||
|
e['miners'] if ('miners' in e and isinstance(e['miners'], int) and e['miners'] >= 0) else (
|
||||||
|
e['workers'] if ('workers' in e and isinstance(e['workers'], int) and e['workers'] >= 0) else (
|
||||||
|
0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
for e in pools['data']
|
||||||
|
]),
|
||||||
|
'count(miners) where miners >= 0': sum([e['miners'] for e in pools['data'] if 'miners' in e and isinstance(e['miners'], int) and e['miners'] > 0]),
|
||||||
|
'count(workers) where workers >= 0': sum([e['workers'] for e in pools['data'] if 'workers' in e and isinstance(e['workers'], int) and e['workers'] > 0]),
|
||||||
|
}
|
||||||
|
bot.say(result)
|
||||||
|
|
74
price.py
74
price.py
|
@ -6,6 +6,7 @@ import random
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
import client
|
import client
|
||||||
|
import csv
|
||||||
|
|
||||||
polourl = "https://poloniex.com/public?command=returnTicker"
|
polourl = "https://poloniex.com/public?command=returnTicker"
|
||||||
poloxmrlendurl = "https://poloniex.com/public?command=returnLoanOrders¤cy=XMR&limit=999999"
|
poloxmrlendurl = "https://poloniex.com/public?command=returnLoanOrders¤cy=XMR&limit=999999"
|
||||||
|
@ -155,6 +156,24 @@ def gecko(bot, trigger):
|
||||||
except:
|
except:
|
||||||
bot.say("Couldn't find {} on le gecko".format(coin))
|
bot.say("Couldn't find {} on le gecko".format(coin))
|
||||||
|
|
||||||
|
@sopel.module.commands('coin', 'coinex')
|
||||||
|
def coinex(bot, trigger):
|
||||||
|
if not trigger.group(2):
|
||||||
|
bot.say(".coin <coin-name> <currency-code>")
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
coinname = trigger.group(2).split(" ")[0]
|
||||||
|
currencyname = trigger.group(2).split(" ")[1]
|
||||||
|
r = requests.get(
|
||||||
|
'https://api.coingecko.com/api/v3/coins/markets?vs_currency={0}&ids={1}&sparkline=false'.
|
||||||
|
format(currencyname, coinname))
|
||||||
|
j = r.json()
|
||||||
|
bot.say("{0} price {1:,.2f} {2}".format(j[0]['name'],
|
||||||
|
float(
|
||||||
|
j[0]['current_price']),
|
||||||
|
currencyname.upper()))
|
||||||
|
except:
|
||||||
|
bot.say("Failed to retrieve price.")
|
||||||
|
|
||||||
@sopel.module.commands('krak', 'kraken')
|
@sopel.module.commands('krak', 'kraken')
|
||||||
def krak(bot, trigger):
|
def krak(bot, trigger):
|
||||||
|
@ -509,6 +528,61 @@ def tall(bot, trigger):
|
||||||
# Send the tickers to IRC
|
# Send the tickers to IRC
|
||||||
bot.say(stringtosend[:-2])
|
bot.say(stringtosend[:-2])
|
||||||
|
|
||||||
|
addys = []
|
||||||
|
@sopel.module.commands('uni')
|
||||||
|
def uni(bot, trigger):
|
||||||
|
addy = trigger.group(2)
|
||||||
|
if len(addy) == 42 and addy[0:2] == "0x":
|
||||||
|
try:
|
||||||
|
r = requests.get("https://api.ethplorer.io/getTokenInfo/{}?apiKey=freekey".format(addy))
|
||||||
|
j = r.json()
|
||||||
|
name = j["name"]
|
||||||
|
symbol = j["symbol"]
|
||||||
|
holders = j["holdersCount"]
|
||||||
|
price = j["price"]["rate"]
|
||||||
|
mcap = j["price"]["marketCapUsd"]
|
||||||
|
vol = j["price"]["volume24h"]
|
||||||
|
bot.say("{} ({}) last price ${:.2f} on {:.2e} vol. Marketcap is ${:.2e} with {:.0f} addresses holding.".format(name, symbol, price, vol, mcap, holders))
|
||||||
|
existflag = False
|
||||||
|
for i in addys:
|
||||||
|
if i[0] == addy:
|
||||||
|
existflag == True
|
||||||
|
if not existflag:
|
||||||
|
addys.append([addy, name, symbol])
|
||||||
|
except:
|
||||||
|
bot.say("Can't find this piece of trash")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
existflag = False
|
||||||
|
for i in addys:
|
||||||
|
if addy == i[1] or addy == i[2]:
|
||||||
|
addy = i[0]
|
||||||
|
existflag = True
|
||||||
|
if not existflag:
|
||||||
|
bot.say("Can't find {}".format(addy))
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
r = requests.get("https://api.ethplorer.io/getTokenInfo/{}?apiKey=freekey".format(addy))
|
||||||
|
j = r.json()
|
||||||
|
name = j["name"]
|
||||||
|
symbol = j["symbol"]
|
||||||
|
holders = j["holdersCount"]
|
||||||
|
price = j["price"]["rate"]
|
||||||
|
mcap = j["price"]["marketCapUsd"]
|
||||||
|
vol = j["price"]["volume24h"]
|
||||||
|
bot.say("{} ({}) last price ${:.2f} on {:.2e} vol. Marketcap is ${:.2e} with {:.0f} addresses holding.".format(name, symbol, price, vol, mcap, holders))
|
||||||
|
existflag = False
|
||||||
|
for i in addys:
|
||||||
|
if i[0] == addy:
|
||||||
|
existflag == True
|
||||||
|
if not existflag:
|
||||||
|
addys.append([addy, name, symbol])
|
||||||
|
except:
|
||||||
|
bot.say("Can't find this piece of trash")
|
||||||
|
return
|
||||||
|
with open('addys.csv', 'w') as f:
|
||||||
|
writer = csv.writer(f)
|
||||||
|
writer.writerows(addys)
|
||||||
|
|
||||||
@sopel.module.commands('usd')
|
@sopel.module.commands('usd')
|
||||||
def usd(bot, trigger):
|
def usd(bot, trigger):
|
||||||
|
|
22
trifling.py
22
trifling.py
|
@ -170,7 +170,7 @@ def collect(bot, trigger):
|
||||||
# the values in Prices must be ints or floats, of course
|
# the values in Prices must be ints or floats, of course
|
||||||
bot.say("Couldn't convert item value to a float! How?!? Why?!?")
|
bot.say("Couldn't convert item value to a float! How?!? Why?!?")
|
||||||
return
|
return
|
||||||
|
|
||||||
value_of_items_collected_in_one_day = quantity * value_of_one_item
|
value_of_items_collected_in_one_day = quantity * value_of_one_item
|
||||||
weekly_coins_to_buy = value_of_items_collected_in_one_day * 7 / coin_price
|
weekly_coins_to_buy = value_of_items_collected_in_one_day * 7 / coin_price
|
||||||
|
|
||||||
|
@ -853,11 +853,11 @@ def whaleornot(bot, trigger):
|
||||||
@sopel.module.commands('trebuchet')
|
@sopel.module.commands('trebuchet')
|
||||||
def trebuchet(bot, trigger):
|
def trebuchet(bot, trigger):
|
||||||
bot.say("Can YOU use a counterweight to launch a 90 kg projectile over 300 meters? Yeah, I thought not.")
|
bot.say("Can YOU use a counterweight to launch a 90 kg projectile over 300 meters? Yeah, I thought not.")
|
||||||
|
|
||||||
@sopel.module.commands('baka')
|
@sopel.module.commands('baka')
|
||||||
def baka(bot, trigger):
|
def baka(bot, trigger):
|
||||||
bot.say('https://www.youtube.com/watch?v=n5n7CSGPzqw')
|
bot.say('https://www.youtube.com/watch?v=n5n7CSGPzqw')
|
||||||
|
|
||||||
@sopel.module.commands('btcdwed')
|
@sopel.module.commands('btcdwed')
|
||||||
def btcdwed(bot, trigger):
|
def btcdwed(bot, trigger):
|
||||||
bot.say('https://www.youtube.com/watch?v=JZYZoQQ6LJQ')
|
bot.say('https://www.youtube.com/watch?v=JZYZoQQ6LJQ')
|
||||||
|
@ -865,16 +865,16 @@ def btcdwed(bot, trigger):
|
||||||
@sopel.module.commands('wayshegoes')
|
@sopel.module.commands('wayshegoes')
|
||||||
def wayshegoes(bot, trigger):
|
def wayshegoes(bot, trigger):
|
||||||
bot.say('https://www.youtube.com/watch?v=3SpihGKmYgY')
|
bot.say('https://www.youtube.com/watch?v=3SpihGKmYgY')
|
||||||
|
|
||||||
@sopel.module.commands('weather')
|
@sopel.module.commands('weather')
|
||||||
def weather(bot, trigger):
|
def weather(bot, trigger):
|
||||||
wk = client.weather_key
|
wk = client.weather_key
|
||||||
try:
|
try:
|
||||||
if not trigger.group(2):
|
if not trigger.group(2):
|
||||||
location = q="san%20francisco"
|
location = q="san%20francisco"
|
||||||
elif trigger.group(2) == 'nioc':
|
elif trigger.group(2) == 'nioc':
|
||||||
location = 'new york city'
|
location = 'new york city'
|
||||||
else:
|
else:
|
||||||
location = trigger.group(2)
|
location = trigger.group(2)
|
||||||
if location.isdigit():
|
if location.isdigit():
|
||||||
location = "zip="+location
|
location = "zip="+location
|
||||||
|
@ -889,3 +889,13 @@ def weather(bot, trigger):
|
||||||
|
|
||||||
except:
|
except:
|
||||||
bot.say("The earth is on fire 🌎🔥")
|
bot.say("The earth is on fire 🌎🔥")
|
||||||
|
|
||||||
|
@sopel.module.commands('yeezy', 'kanye', 'ye')
|
||||||
|
def yeezy(bot, trigger):
|
||||||
|
#headers = {'User-Agent': 'monerobux-irc-bot-#wownero'}
|
||||||
|
r = requests.get('https://api.kanye.rest')
|
||||||
|
#resp.raise_for_status()
|
||||||
|
j = r.json()
|
||||||
|
#if 'quote' not in blob or not isinstance(blob['quote'], str):
|
||||||
|
# raise Exception('malformed response')
|
||||||
|
bot.say(j['quote'])
|
||||||
|
|
Loading…
Reference in New Issue