test sync
This commit is contained in:
parent
6f6aa28cee
commit
2a9aa2419d
5 changed files with 33 additions and 11 deletions
|
@ -13,7 +13,7 @@ def urban(inp):
|
||||||
defs = page['list']
|
defs = page['list']
|
||||||
|
|
||||||
if page['result_type'] == 'no_results':
|
if page['result_type'] == 'no_results':
|
||||||
return 'not found.'
|
return 'Not found.'
|
||||||
|
|
||||||
out = defs[0]['word'] + ': ' + defs[0]['definition']
|
out = defs[0]['word'] + ': ' + defs[0]['definition']
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ def define(inp):
|
||||||
|
|
||||||
correction = h.xpath('//span[@class="correct-word"]/text()')
|
correction = h.xpath('//span[@class="correct-word"]/text()')
|
||||||
if correction:
|
if correction:
|
||||||
result = 'definition for "%s": ' % correction[0]
|
result = 'Definition for "%s": ' % correction[0]
|
||||||
|
|
||||||
sections = []
|
sections = []
|
||||||
for section in definition:
|
for section in definition:
|
||||||
|
|
|
@ -6,7 +6,6 @@ fortunes = ["Help! I'm stuck in the fortune cookie factory!",
|
||||||
"He who laughs at himself never runs out of things to laugh at.",
|
"He who laughs at himself never runs out of things to laugh at.",
|
||||||
"The world is your oyster.",
|
"The world is your oyster.",
|
||||||
"Today will be a good day.",
|
"Today will be a good day.",
|
||||||
"Only listen to the Hoss Fortune Cookies. Disregard all other fortune telling units.",
|
|
||||||
"Life's short, party naked.",
|
"Life's short, party naked.",
|
||||||
"Haters gonna hate.",
|
"Haters gonna hate.",
|
||||||
"You are amazing and let no one tell you otherwise.",
|
"You are amazing and let no one tell you otherwise.",
|
||||||
|
|
|
@ -4,8 +4,11 @@ import string
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def mcstatus(inp, bot=None):
|
def mcstatus(inp, bot=None):
|
||||||
".mcstatus - Attempts to log in to minecraft"
|
".mcstatus - Attempts to log in to minecraft"
|
||||||
username = bot.config["api_keys"]["mc_user"]
|
username = bot.config.get("api_keys", {}).get("mc_user", None)
|
||||||
password = bot.config["api_keys"]["mc_pass"]
|
password = bot.config.get("api_keys", {}).get("mc_pass", None)
|
||||||
|
if api_key is None:
|
||||||
|
return "error: no api key set"
|
||||||
|
|
||||||
login = http.get("https://login.minecraft.net/?user="+username+"&password="+password+"&version=13")
|
login = http.get("https://login.minecraft.net/?user="+username+"&password="+password+"&version=13")
|
||||||
if username.lower() in login.lower():
|
if username.lower() in login.lower():
|
||||||
return "Minecraft login servers appear to be online!"
|
return "Minecraft login servers appear to be online!"
|
||||||
|
|
|
@ -133,7 +133,7 @@ class WhoisOrg(WhoisEntry):
|
||||||
'registrar': 'Registrar:\s?(.+)',
|
'registrar': 'Registrar:\s?(.+)',
|
||||||
'whois_server': 'Whois Server:\s?(.+)',
|
'whois_server': 'Whois Server:\s?(.+)',
|
||||||
'referral_url': 'Referral URL:\s?(.+)', # http url of whois_server
|
'referral_url': 'Referral URL:\s?(.+)', # http url of whois_server
|
||||||
'updated_date': 'Updated Date:\s?(.+)',
|
'updated_date': 'Last Updated On:\s?(.+)',
|
||||||
'creation_date': 'Created On:\s?(.+)',
|
'creation_date': 'Created On:\s?(.+)',
|
||||||
'expiration_date': 'Expiration Date:\s?(.+)',
|
'expiration_date': 'Expiration Date:\s?(.+)',
|
||||||
'name_servers': 'Name Server:\s?(.+)', # list of name servers
|
'name_servers': 'Name Server:\s?(.+)', # list of name servers
|
||||||
|
|
|
@ -9,11 +9,31 @@ def whois(inp, say=None):
|
||||||
|
|
||||||
print w
|
print w
|
||||||
|
|
||||||
domain_name = w.domain_name[0]
|
try:
|
||||||
expiration_date = w.expiration_date[0]
|
domain_name = w.domain_name[0]
|
||||||
creation_date = w.creation_date[0]
|
except IndexError, e:
|
||||||
registrant_email = w.emails[0]
|
domain_name: "none."
|
||||||
administrative_email = w.emails[1]
|
|
||||||
|
try:
|
||||||
|
expiration_date = w.expiration_date[0]
|
||||||
|
except IndexError, e:
|
||||||
|
expiration_date: "none."
|
||||||
|
|
||||||
|
try:
|
||||||
|
creation_date = w.creation_date[0]
|
||||||
|
except IndexError, e:
|
||||||
|
creation_date: "none."
|
||||||
|
|
||||||
|
try:
|
||||||
|
registrant_email = w.emails[0]
|
||||||
|
except:
|
||||||
|
registrant_email: "none."
|
||||||
|
|
||||||
|
try:
|
||||||
|
administrative_email = w.emails[1]
|
||||||
|
except:
|
||||||
|
administrative_email: "none."
|
||||||
|
|
||||||
say('Domain recognised! %s was registered on \x02%s\x02 and will expire on \x02%s\x02' % (domain_name, creation_date, expiration_date))
|
say('Domain recognised! %s was registered on \x02%s\x02 and will expire on \x02%s\x02' % (domain_name, creation_date, expiration_date))
|
||||||
say('Registrant email: %s Administrative email: %s' % (registrant_email, administrative_email))
|
say('Registrant email: %s Administrative email: %s' % (registrant_email, administrative_email))
|
||||||
|
|
||||||
|
|
Reference in a new issue