Merge remote-tracking branch 'jwinterm/master' into shill

This commit is contained in:
shillogatu 2017-11-28 16:28:26 -06:00
commit bf57fb7762
4 changed files with 111 additions and 30 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
client.py client.py
*.pyc *.pyc
apikey.py apikey.py
redditcredentials.py

View File

@ -2,7 +2,7 @@ import sopel.module
import requests import requests
import re import re
networkurl = "http://api.minexmr.com:8080/stats" networkurl = "http://node.xmrbackb.one:18081/getinfo"
@sopel.module.commands('fork', 'forkening') @sopel.module.commands('fork', 'forkening')
def fork(bot, trigger): def fork(bot, trigger):
@ -12,7 +12,7 @@ def fork(bot, trigger):
except Exception,e: except Exception,e:
pass pass
try: try:
height=j["network"]["height"] height=j["height"]
forkheight=1400000 forkheight=1400000
if forkheight > height: if forkheight > height:
bot.say("The current block height is {0:,}. Fork height is {1:,}. {2:,} blocks to go, happening in approximately {3:.2f} hours.".format(height,forkheight,forkheight-height,(forkheight-height)/30.0)) bot.say("The current block height is {0:,}. Fork height is {1:,}. {2:,} blocks to go, happening in approximately {3:.2f} hours.".format(height,forkheight,forkheight-height,(forkheight-height)/30.0))
@ -29,8 +29,8 @@ def network(bot, trigger):
except Exception,e: except Exception,e:
pass pass
try: try:
height=j["network"]["height"] height=j["height"]
diff=j["network"]["difficulty"] diff=j["difficulty"]
hashrate=float(diff)/120 hashrate=float(diff)/120
bot.say("The current block height is {0:,}. Difficulty is {1:,}. Hashrate is {2:.2f} Mh/s.".format(height,diff,hashrate/1e6)) bot.say("The current block height is {0:,}. Difficulty is {1:,}. Hashrate is {2:.2f} Mh/s.".format(height,diff,hashrate/1e6))
except: except:
@ -62,3 +62,20 @@ def blocksize(bot, trigger):
bot.say("Median blocksize over last 200 blocks is {0} bytes".format(size.group(1))) bot.say("Median blocksize over last 200 blocks is {0} bytes".format(size.group(1)))
except: except:
bot.say("Bomething sorked 0_0") bot.say("Bomething sorked 0_0")
@sopel.module.commands('mine')
def mine(bot, trigger):
try:
r=requests.get('https://supportxmr.com/api/network/stats')
j=r.json()
diff=float(j['difficulty'])
value=float(j['value'])/1e12
hashrate=float(trigger.group(2))
xmrperday=(hashrate/(diff/120))*720*value
bot.say("At {:.0f} h/s with network diff of {:.2e} and block reward {:.2f} you can expect {:.4f} XMR per day.".format(hashrate, diff, value, xmrperday))
except:
bot.say("Mining is for suckers.")
@sopel.module.commands('b2x')
def b2x(bot, trigger):
bot.say("Fuck off \\x")

View File

@ -439,8 +439,11 @@ def tall(bot, trigger):
usdcny = fixerjson['rates']['CNY'] usdcny = fixerjson['rates']['CNY']
usdeur = fixerjson['rates']['EUR'] usdeur = fixerjson['rates']['EUR']
usdjpy = fixerjson['rates']['JPY'] usdjpy = fixerjson['rates']['JPY']
usdkrw = fixerjson['rates']['KRW']
except: except:
usdcny = 7 usdcny = 7
usdkrw = 1100
usdjpy = 112
# Bitstamp # Bitstamp
try: try:
stampresult = requests.get(stampurl) stampresult = requests.get(stampurl)
@ -484,14 +487,24 @@ def tall(bot, trigger):
finexjson = False finexjson = False
if finexjson: if finexjson:
stringtosend += "Bitfinex last: {0:,.2f}, vol: {1:,.1f} | ".format(float(finexjson['last_price']), float(finexjson['volume'])) stringtosend += "Bitfinex last: {0:,.2f}, vol: {1:,.1f} | ".format(float(finexjson['last_price']), float(finexjson['volume']))
# BTCC # Bitthumb
try: try:
btccresult = requests.get(btccurl) thumbresult = requests.get(thumbbtcurl)
btccjson = btccresult.json() thumbjson = thumbresult.json()
if thumbjson['data']:
pass
except: except:
btccjson = False thumbjson = False
if btccjson: if thumbjson:
stringtosend += "BTCC last: {0:,.2f}, vol: {1:,.1f} | ".format(float(btccjson['ticker']['last'])/usdcny, float(btccjson['ticker']['vol'])) stringtosend += "Bithumb last: {0:,.2f}, vol: {1:,.1f} | ".format(float(thumbjson['data']['buy_price'])/float(usdkrw), float(thumbjson['data']['volume_1day']))
# BTCC
# try:
# btccresult = requests.get(btccurl)
# btccjson = btccresult.json()
# except:
# btccjson = False
# if btccjson:
# stringtosend += "BTCC last: {0:,.2f}, vol: {1:,.1f} | ".format(float(btccjson['ticker']['last'])/usdcny, float(btccjson['ticker']['vol']))
# Huobi # Huobi
try: try:
huobiresult = requests.get(huobiurl) huobiresult = requests.get(huobiurl)
@ -749,6 +762,23 @@ def gbp(bot, trigger):
except: except:
bot.say("Failed to retrieve price.") bot.say("Failed to retrieve price.")
@sopel.module.commands('inr')
def inr(bot, trigger):
# Get conversion rate
try:
fixerresult = requests.get(fixerurl)
fixerjson = fixerresult.json()
usdthb = fixerjson['rates']['INR']
except:
usdthb = 64
try:
r=requests.get('https://api.coinmarketcap.com/v1/ticker/monero/')
j=r.json()
price=float(j[0]['price_usd'])*usdthb
bot.say("Monero price in INR = ₹{0:,.2f}".format(price))
except:
bot.say("Failed to retrieve price.")
@sopel.module.commands('thb') @sopel.module.commands('thb')
def thb(bot, trigger): def thb(bot, trigger):
# Get conversion rate # Get conversion rate

View File

@ -4,7 +4,7 @@ import random
import re import re
import requests import requests
import praw import praw
from client import * import client
from threading import Timer from threading import Timer
@sopel.module.commands('4matter') @sopel.module.commands('4matter')
@ -54,6 +54,10 @@ def buyorsell(bot, trigger):
silly_string = "Buy, buy, buy!" silly_string = "Buy, buy, buy!"
bot.say(silly_string) bot.say(silly_string)
@sopel.module.commands('cheerup')
def cheerup(bot, trigger):
bot.say('https://www.youtube.com/watch?v=NXfC16rv_fs')
@sopel.module.commands('china') @sopel.module.commands('china')
def china(bot, trigger): def china(bot, trigger):
bot.say('https://youtu.be/ZrNrleD2ZFs') bot.say('https://youtu.be/ZrNrleD2ZFs')
@ -100,12 +104,17 @@ def ded(bot, trigger):
@sopel.module.commands('donate', 'donation') @sopel.module.commands('donate', 'donation')
def donate(bot, trigger): def donate(bot, trigger):
bot.say('45SkxgDmcLmW5ByS7w9AG78JuJRvCoVKCdGJWnd4US95CBUAtvdGAdM2oHgZgTGjkEAUcwdqcryM819aqdeiKxHSQC8HkmS', trigger.nick) bot.say('XMR: 45SkxgDmcLmW5ByS7w9AG78JuJRvCoVKCdGJWnd4US95CBUAtvdGAdM2oHgZgTGjkEAUcwdqcryM819aqdeiKxHSQC8HkmS', trigger.nick)
bot.say('BTC: 14X8aMUtuxH2HWLtsNAxxN7j9uqQNUdMzB', trigger.nick)
@sopel.module.commands('dump') @sopel.module.commands('dump')
def dump(bot, trigger): def dump(bot, trigger):
bot.say('https://www.youtube.com/watch?v=RHg8qIKJo1I') bot.say('https://www.youtube.com/watch?v=RHg8qIKJo1I')
@sopel.module.commands('encrypt')
def encrypt(bot, trigger):
bot.say("https doesn't hide the fact that i'm using https so that's why i don't use encryption because everyone is trying to crack encryption so i just don't use encryption because no one is looking at unencrypted data because everyone wants encrypted data to crack")
@sopel.module.commands('eth') @sopel.module.commands('eth')
def eth(bot, trigger): def eth(bot, trigger):
bot.say(u'The world computer 💻🌐'.encode('utf8')) bot.say(u'The world computer 💻🌐'.encode('utf8'))
@ -151,15 +160,17 @@ def hitler(bot, trigger):
@sopel.module.commands('hmm', 'hmmm') @sopel.module.commands('hmm', 'hmmm')
def hmm(bot, trigger): def hmm(bot, trigger):
# try: reddit = praw.Reddit(client_id=client.client_id, client_secret=client.client_secret, user_agent='asdfasdfasdfjhwrgth', username=client.username, password=client.password)
sub=reddit.subreddit('hmmm')
posts=sub.new(limit=100) #try:
n=random.randint(0,100) sub=reddit.subreddit('hmmm')
for i, post in enumerate(posts): posts=sub.new(limit=100)
if i==n: n=random.randint(0,100)
bot.say(post.url) for i, post in enumerate(posts):
# except: if i==n:
# bot.say("Something something reddit's servers") bot.say(post.url)
#except:
# bot.say("Something something reddit's servers")
herooptions = [ herooptions = [
"https://video.twimg.com/tweet_video/DEnItJjV0AI81CK.mp4", "https://video.twimg.com/tweet_video/DEnItJjV0AI81CK.mp4",
@ -196,9 +207,16 @@ def isittrue(bot, trigger):
def jaxx(bot, trigger): def jaxx(bot, trigger):
bot.say(u'This command will be implemented soon. Honest. Especially if the devs can provide some unpaid assistance. Soon™...') bot.say(u'This command will be implemented soon. Honest. Especially if the devs can provide some unpaid assistance. Soon™...')
@sopel.module.commands('joshua1234') @sopel.module.commands('jimbell')
def jaxx(bot, trigger):
if not trigger.group(2):
bot.say(u'https://en.wikipedia.org/wiki/Jim_Bell')
else:
bot.say(u'{} has opened an assassination futures market predicting the impending demise of {}.'.format(trigger.nick, trigger.group(2)))
@sopel.module.commands('john_alan')
def joshua(bot, trigger): def joshua(bot, trigger):
bot.say(u'The first, second, third, and fourth amongst joshes.') bot.say(u'I like smooth.')
@sopel.module.commands('jwinterm') @sopel.module.commands('jwinterm')
def jwinterm(bot, trigger): def jwinterm(bot, trigger):
@ -208,6 +226,10 @@ def jwinterm(bot, trigger):
def kid(bot, trigger): def kid(bot, trigger):
bot.say(u'What up kid?') bot.say(u'What up kid?')
@sopel.module.commands('koan')
def koan(bot, trigger):
bot.say("The use cases are many and varied")
@sopel.module.commands('kramer') @sopel.module.commands('kramer')
def kramer(bot, trigger): def kramer(bot, trigger):
bot.say("Waiting for a retrace to 0.007") bot.say("Waiting for a retrace to 0.007")
@ -277,6 +299,10 @@ odboptions = [
def odb(bot, trigger): def odb(bot, trigger):
bot.say(random.choice(odboptions)) bot.say(random.choice(odboptions))
@sopel.module.commands('orff')
def orff(bot, trigger):
bot.say("O Fortuna velut luna statu variabilis, semper crescis aut decrescis; vita detestabilis nunc obdurat et tunc curat ludo mentis aciem, egestatem, potestatem dissolvit ut glaciem.")
@sopel.module.commands('pamp') @sopel.module.commands('pamp')
def pamp(bot, trigger): def pamp(bot, trigger):
bot.say("Pamp o clock yet?") bot.say("Pamp o clock yet?")
@ -302,6 +328,10 @@ def pony(bot, trigger):
def primer(bot, trigger): def primer(bot, trigger):
bot.say("The point is not how much i made, point is fluffy did this on purpose, more than 10 people were in on it. His commit access needs to be revoked asap!") bot.say("The point is not how much i made, point is fluffy did this on purpose, more than 10 people were in on it. His commit access needs to be revoked asap!")
@sopel.module.commands('pubg')
def pubg(bot, trigger):
bot.say("https://i.redd.it/o6o5gqmetacz.jpg")
confirmoptions = [ confirmoptions = [
"I can confirm that it is true", "I can confirm that it is true",
"This is true", "This is true",
@ -424,13 +454,9 @@ def trivia(bot, trigger):
bot.say("No trivia for you!") bot.say("No trivia for you!")
reddit=praw.Reddit(client_id=client_id,
client_secret=client_secret,
user_agent='monerobux',
username=username,
password=password)
@sopel.module.commands('tinytrump') @sopel.module.commands('tinytrump')
def tinytrump(bot, trigger): def tinytrump(bot, trigger):
reddit = praw.Reddit(client_id=client.client_id, client_secret=client.client_secret, user_agent='asdfasdfasdfjhwrgth', username=client.username, password=client.password)
try: try:
sub=reddit.subreddit('tinytrump') sub=reddit.subreddit('tinytrump')
posts=sub.new(limit=100) posts=sub.new(limit=100)
@ -474,6 +500,10 @@ urmomoptions = [
def urmom(bot, trigger): def urmom(bot, trigger):
bot.say(random.choice(urmomoptions)) bot.say(random.choice(urmomoptions))
@sopel.module.commands('verge', 'xvg', 'wraith')
def verge(bot, trigger):
bot.say(u"👻🐕 Don't wraith my dark doge bro! 👻🐕".encode('utf8'))
vitalikoptions = [ vitalikoptions = [
"https://pbs.twimg.com/media/CrWjczJXgAExF2S.jpg", "https://pbs.twimg.com/media/CrWjczJXgAExF2S.jpg",
"mETH, not even once: https://cdn-az.allevents.in/banners/e7df519e0808bac49fa3aaf503aff87d", "mETH, not even once: https://cdn-az.allevents.in/banners/e7df519e0808bac49fa3aaf503aff87d",
@ -484,13 +514,12 @@ vitalikoptions = [
def vitalik(bot, trigger): def vitalik(bot, trigger):
bot.say(random.choice(vitalikoptions)) bot.say(random.choice(vitalikoptions))
@sopel.module.commands('wat') @sopel.module.commands('wat')
def wat(bot, trigger): def wat(bot, trigger):
bot.say("https://www.destroyallsoftware.com/talks/wat") bot.say("https://www.destroyallsoftware.com/talks/wat")
@sopel.module.commands('yoda') @sopel.module.commands('yoda')
def wat(bot, trigger): def yoda(bot, trigger):
bot.say("The optimism is strong in this one") bot.say("The optimism is strong in this one")
@sopel.module.commands('xrp') @sopel.module.commands('xrp')
@ -517,6 +546,10 @@ def wave(bot, trigger):
#def politics(bot, trigger): #def politics(bot, trigger):
# bot.reply("politics is the mind killer") # bot.reply("politics is the mind killer")
@sopel.module.rule('.*1Dj34exPs3S9qAV1aiGAAADzbashsSVKVP*.')
def scamdouble(bot, trigger):
bot.say("{} is a scammer and bitcoin is a scam".format(trigger.nick))
@sopel.module.commands('asp') @sopel.module.commands('asp')
def asp(bot, trigger): def asp(bot, trigger):
polourl = "https://poloniex.com/public?command=returnTicker" polourl = "https://poloniex.com/public?command=returnTicker"