Compare commits
No commits in common. "77fcdad55d40b9aa08f5abbb015c31a1e9a6d860" and "aabb8e759d7454ef3a27634101e0c08f38456cd2" have entirely different histories.
77fcdad55d
...
aabb8e759d
24
network.py
24
network.py
|
@ -95,27 +95,3 @@ def solo(bot, trigger):
|
|||
@sopel.module.commands('b2x')
|
||||
def b2x(bot, trigger):
|
||||
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,7 +6,6 @@ import random
|
|||
import datetime
|
||||
import re
|
||||
import client
|
||||
import csv
|
||||
|
||||
polourl = "https://poloniex.com/public?command=returnTicker"
|
||||
poloxmrlendurl = "https://poloniex.com/public?command=returnLoanOrders¤cy=XMR&limit=999999"
|
||||
|
@ -156,24 +155,6 @@ def gecko(bot, trigger):
|
|||
except:
|
||||
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')
|
||||
def krak(bot, trigger):
|
||||
|
@ -528,61 +509,6 @@ def tall(bot, trigger):
|
|||
# Send the tickers to IRC
|
||||
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')
|
||||
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
|
||||
bot.say("Couldn't convert item value to a float! How?!? Why?!?")
|
||||
return
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
@ -853,11 +853,11 @@ def whaleornot(bot, trigger):
|
|||
@sopel.module.commands('trebuchet')
|
||||
def trebuchet(bot, trigger):
|
||||
bot.say("Can YOU use a counterweight to launch a 90 kg projectile over 300 meters? Yeah, I thought not.")
|
||||
|
||||
|
||||
@sopel.module.commands('baka')
|
||||
def baka(bot, trigger):
|
||||
bot.say('https://www.youtube.com/watch?v=n5n7CSGPzqw')
|
||||
|
||||
|
||||
@sopel.module.commands('btcdwed')
|
||||
def btcdwed(bot, trigger):
|
||||
bot.say('https://www.youtube.com/watch?v=JZYZoQQ6LJQ')
|
||||
|
@ -865,16 +865,16 @@ def btcdwed(bot, trigger):
|
|||
@sopel.module.commands('wayshegoes')
|
||||
def wayshegoes(bot, trigger):
|
||||
bot.say('https://www.youtube.com/watch?v=3SpihGKmYgY')
|
||||
|
||||
|
||||
@sopel.module.commands('weather')
|
||||
def weather(bot, trigger):
|
||||
wk = client.weather_key
|
||||
try:
|
||||
if not trigger.group(2):
|
||||
location = q="san%20francisco"
|
||||
location = q="san%20francisco"
|
||||
elif trigger.group(2) == 'nioc':
|
||||
location = 'new york city'
|
||||
else:
|
||||
else:
|
||||
location = trigger.group(2)
|
||||
if location.isdigit():
|
||||
location = "zip="+location
|
||||
|
@ -889,13 +889,3 @@ def weather(bot, trigger):
|
|||
|
||||
except:
|
||||
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