Massive code dump :o

This commit is contained in:
Luke Rogers 2012-02-03 02:05:11 +13:00
parent 185c1d5ae3
commit 9bc8901972
60 changed files with 5781 additions and 125 deletions

View file

@ -5,14 +5,27 @@ from BeautifulSoup import BeautifulSoup
@hook.command(autohelp=False)
def fact(inp, say=False, nick=False):
".fact -- gets a fact from OMGFACTS"
fact = None
while fact is None:
try:
fact, link = get_fact()
except:
pass
return "%s [ %s ]" % (fact, link)
def get_fact():
page = http.get('http://www.omg-facts.com/random')
soup = BeautifulSoup(page)
container = soup.find('a', {'class' : 'surprise'})
link = container['href']
fact = misc.strip_html(container.renderContents())
return "%s [ %s ]" % (fact, link)
if fact:
return (fact, link)
else:
raise nofact

View file

@ -66,24 +66,23 @@ def remember(inp, nick='', db=None, say=None, input=None, notice=None):
return
@hook.command("f")
def forget(inp, db=None):
def forget(inp, db=None, input=None, notice=None):
".f <word> -- forgets the mapping that word had"
try:
head, tail = inp.split(None, 1)
except ValueError:
return remember.__doc__
if input.nick not in input.bot.config["admins"]:
return
db_init(db)
data = get_memory(db, binp)
data = get_memory(db, inp)
if data:
db.execute("delete from mem where word=lower(?)",
(inp))
[inp])
db.commit()
return 'forgot `%s`' % data.replace('`', "'")
notice('`%s` has been forgotten.' % data.replace('`', "'"))
return
else:
return "I don't know about that."
notice("I don't know about that.")
return
@hook.command("info")
@hook.regex(r'^\? ?(.+)')

View file

@ -29,4 +29,3 @@ def calc(inp):
output = misc.strip_html(output)
return output

77
plugins/get.py Normal file
View file

@ -0,0 +1,77 @@
#-*- coding: utf-8 -*-
# Copyright (C) 2011 by Guilherme Pinto Gonçalves, Ivan Sichmman Freitas
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from util import hook
import sys
import subprocess
from functools import partial
fortunes = {
'fortunes': 'fortunes',
'fortune': 'fortunes',
'quotes': 'literature',
'quote': 'literature',
'riddle': 'riddles',
'riddles': 'riddles',
'cookie': 'cookie',
'cookies': 'cookie',
'disclaimer': 'disclaimer',
'f': 'fortunes',
'q': 'literature',
'r': 'riddles'
}
# Use this later to replace the fortunes list workaaround
def get_installed_fortunes():
try:
proc = subprocess.Popen(("/usr/bin/fortune", "-f"),
stderr = subprocess.PIPE)
except OSError:
return set()
return set(proc.stderr)
# Use this later to replace the fortunes list workaaround
def get_fortune(inp):
try:
proc = subprocess.Popen(("fortune", "-a", inp),
stderr = subprocess.PIPE,
stdout = subprocess.PIPE)
except OSError:
return set()
return set(proc.stderr)
@hook.command()
def get(inp, say=None):
".get <what> -- uses fortune-mod to get something. <what> can be riddle, quote or fortune"
fortune = get_fortune(fortune[inp])
while fortune.length() =< 5:
fortune = get_fortune(fortune[inp])
if proc.wait() == 0:
for line in proc.stdout:
say(line.lstrip())
else:
return "Fortune failed: " + proc.stderr.read()

View file

@ -10,12 +10,12 @@ def md5(inp):
def sha1(inp):
".hash <text> -- returns a sha1 hash of <text>"
return hashlib.sha1(inp).hexdigest()
@hook.command
def sha256(inp):
".hash <text> -- returns a sha256 hash of <text>"
return hashlib.sha256(inp).hexdigest()
@hook.command
def sha512(inp):
".hash <text> -- returns a sha512 hash of <text>"

117
plugins/karma.py Normal file
View file

@ -0,0 +1,117 @@
# Karma plugin for Skybot
# Written by GhettoWizard(2011)
import time
import re
from util import hook, timesince
def up(db, nick_vote):
db.execute("""UPDATE karma SET
up_karma = up_karma+1,
total_karma = total_karma+1 WHERE nick_vote=?""", (nick_vote.lower(),))
db.commit()
def down(db, nick_vote):
db.execute("""UPDATE karma SET
down_karma = down_karma+1,
total_karma = total_karma+1 WHERE nick_vote=?""", (nick_vote.lower(),))
db.commit()
def allowed(db, nick, nick_vote):
time_restriction = 3600
db.execute("""DELETE FROM karma_voters WHERE ? - epoch >= 3600""",
(time.time(),))
db.commit()
check = db.execute("""SELECT epoch FROM karma_voters WHERE voter=? AND votee=?""",
(nick.lower(), nick_vote.lower())).fetchone()
if check:
check = check[0]
if time.time() - check >= time_restriction:
db.execute("""INSERT OR REPLACE INTO karma_voters(
voter,
votee,
epoch) values(?,?,?)""", (nick.lower(), nick_vote.lower(), time.time()))
db.commit()
return True#, 0
else:
return False#, timesince.timeuntil(check, now=time.time()-time_restriction)
else:
db.execute("""INSERT OR REPLACE INTO karma_voters(
voter,
votee,
epoch) values(?,?,?)""", (nick.lower(), nick_vote.lower(), time.time()))
db.commit()
return True#, 0
# TODO Make this work on multiple matches in a string, right now it'll only
# work on one match. Scaevolus might have to change the hook function to work
# with findall, as search seems limited.
# karma_re = ('((\S+)(\+\+|\-\-))+', re.I)
karma_re = ('(.+)(\+\+|\-\-)$', re.I)
@hook.regex(*karma_re)
def karma_add(match, nick='', chan='', db=None):
nick_vote = match.group(1).strip()
if nick.lower() == nick_vote.lower():
return
vote_allowed = allowed(db, nick, nick_vote)
if vote_allowed:
if match.group(2) == '++':
db.execute("""INSERT or IGNORE INTO karma(
nick_vote,
up_karma,
down_karma,
total_karma) values(?,?,?,?)""", (nick_vote.lower(),0,0,0))
up(db, nick_vote)
if match.group(2) == '--':
db.execute("""INSERT or IGNORE INTO karma(
nick_vote,
up_karma,
down_karma,
total_karma) values(?,?,?,?)""", (nick_vote.lower(),0,0,0))
down(db, nick_vote)
else:
return
else:
return
return
@hook.command('k')
@hook.command
def karma(inp, nick='', chan='', db=None):
""".k/.karma <nick> -- returns karma stats for <nick>"""
db.execute("""CREATE TABLE if not exists karma(
nick_vote TEXT PRIMARY KEY,
up_karma INTEGER,
down_karma INTEGER,
total_karma INTEGER)""")
db.execute("""CREATE TABLE if not exists karma_voters(
voter TEXT,
votee TEXT,
epoch FLOAT,
PRIMARY KEY(voter, votee))""")
if not chan.startswith('#'):
return
nick_vote = inp
out = db.execute("""SELECT * FROM karma WHERE nick_vote=?""",
(nick_vote.lower(),)).fetchall()
if not out:
return "no karma"
else:
out = out[0]
return "'%s' has %s karma" % (nick_vote, out[1]-out[2])
return

36
plugins/kill.py Normal file
View file

@ -0,0 +1,36 @@
from util import hook
import re
import random
kills = ["rips off <who>'s <body> and leaves them to die.",
"grabs <who>'s head and rips it clean off their body.",
"grabs a machine gun and riddles <who>'s body with bullets.",
"gags and ties <who> then throws them off a bridge.",
"crushes <who> with a huge spiked boulder.",
"rams a rocket launcher up <who>'s ass and lets off a few rounds.",
"crushes <who>'s skull in with a spiked mace."]
body = ['head',
'arms',
'leg',
'arm',
'"special parts"']
@hook.command
def kill(inp, me = None, nick = None, input=None, notice=None):
".kill <user> - kill a user"
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):
notice("Invalid username!")
return
if inp == input.conn.nick.lower() or inp == "itself":
msg = 'kills ' + nick + ' and rakes their corpse (:3)'
else:
kill = random.choice(kills)
kill = re.sub ('<who>', inp, kill)
msg = re.sub ('<body>', random.choice(body), kill)
me(msg)

View file

@ -1,7 +1,7 @@
from util import hook, http
api_key = ""
api_key = "71ebca1c7e6b12ccd900efed95f7c1e0"
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"

38
plugins/location.py Normal file
View file

@ -0,0 +1,38 @@
from util import hook
def find_location(ip, api):
import string
import urllib
response = urllib.urlopen("http://api.ipinfodb.com/v3/ip-city/?key="+api+"&ip="+ip).read()
response = response.split(";")
give = {}
give["country"] = response[4].title()
give["country_short"] = response[3].upper()
give["state"] = response[5].title()
give["city"] = response[6].title()
give["timezone"] = response[10].title()
return give
def timezone(ip):
time = find_location(ip)["timezone"]
time = time.replace(":",".")
time = time.replace(".00","")
return int(time)
@hook.command
def locations(inp, say = None, me = None, bot = None):
".location <ip> - Performs a GeoIP check on the ip given."
api = bot.config['api_keys']['geoip']
if api == "":
return "No API key"
give = find_location(inp, api)
if give["country"] not in [""," ","-"," - "]:
if give["state"] == give["city"]:
localstring = give["city"]
else:
localstring = give["city"] + ", " + give["state"]
say("That IP comes from " + give["country"] + " (" + give["country_short"] + ")")
say("I think it's in " + localstring + " with a timezone of " + give["timezone"] + "GMT")
else:
say("Either that wasn't an IP or I cannot locate it in my database. :(")
return

View file

@ -18,7 +18,7 @@ def get_info(host, port):
sock.close()
return "%s - %d/%d players" % (values[0], int(values[1]), int(values[2]))
except:
return "Error pinging "+host+":"+str(port)+", is it up? double-check your address!"
return "Error pinging "+host+":"+str(port)+", is it up? double-check your address!"
@hook.command
def mcping(inp):

View file

@ -3,12 +3,10 @@ import string
@hook.command(autohelp=False)
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"]
password = bot.config["api_keys"]["mc_pass"]
login = http.get("https://login.minecraft.net/?user="+username+"&password="+password+"&version=13")
print "Username: " + username
print "Response: " + login
if username.lower() in login.lower():
return "Minecraft login servers appear to be online!"
else:
@ -16,7 +14,7 @@ def mcstatus(inp, bot=None):
@hook.command
def mclogin(inp, say=None):
".mclogin <username> <password> -- Attempts to log in to minecraft using the provided username and password, this is NOT logged."
".mclogin <username> <password> - Attempts to log in to minecraft using the provided username and password, this is NOT logged."
inp = inp.split(" ")
username = inp[0]
password = inp[1]
@ -29,7 +27,7 @@ def mclogin(inp, say=None):
@hook.command
def haspaid(inp):
".haspaid <username> -- Checks if a user has a premium Minecraft account"
".haspaid <username> - Checks if a user has a premium Minecraft account"
login = http.get("http://www.minecraft.net/haspaid.jsp?user=" + inp)
if "true" in login:
return "The account \'" + inp + "\' is a premium Minecraft account! :D"

View file

@ -3,7 +3,7 @@ import socket
import subprocess
import time
from util import hook
from util import hook, http
socket.setdefaulttimeout(10) # global setting
@ -45,6 +45,11 @@ def onjoin(paraml, conn=None, bot=None):
conn.join(channel)
time.sleep(1) # don't flood JOINs
# set user-agent
http.ua_skybot = 'CloudBot'
@hook.regex(r'^\x01VERSION\x01$')
def version(inp, notice=None):
notice('\x01VERSION CloudBot/DEV - https://github.com/lukeroge/CloudBot')

View file

@ -1,25 +1,23 @@
from util import hook,molecular
import string
import unicodedata
@hook.command()
def namegen(inp, say = None, nick = None, input=None, notice=None):
".namegen [modules] -- generates some names using the chosen modules. \".namegen list\" will display a list of all modules"
gen = molecular.Molecule()
all_modules = ["dever_f", "dwarves", "elves_m", "fantasy", "harn_cln", "harn_gar", "harn_m2", "harn_s_m", "human_m", "narn", "dever_m", "elves_d", "elves_n", "felana", "harn_f2", "harn_k_f", "harn_m", "hobbits", "inns", " orcs_t", "dragon", "elves_f", "elves_t", "general", "harn_f", "harn_k_m", "harn_s_f", "human_f", "items", "orcs_wh"]
all_modules = ["dever_f", "dwarves", "elves_m", "fantasy", "harn_cln", "harn_gar", "harn_m2", " harn_s_m", "human_m", "narn", "dever_m", "elves_d", "elves_n", "felana", " harn_f2", "harn_k_f", "harn_m", "hobbits", "inns", " orcs_t", "dragon", "elves_f", "elves_t", "general", "harn_f", "harn_k_m", "harn_s_f", "human_f", "items", "orcs_wh", "wc_tribes", "wc_cats"]
modules = []
inp.lower()
if inp == "list":
notice("Available modules: dever_f, dwarves, elves_m, fantasy, harn_cln, harn_gar, harn_m2, harn_s_m, human_m, narn, dever_m, elves_d, elves_n, felana, harn_f2, harn_k_f, harn_m, hobbits, inns, orcs_t, dragon, elves_f, elves_t, general, harn_f, harn_k_m, harn_s_f, human_f, items, orcs_wh")
notice("Available modules: dever_f, dwarves, elves_m, fantasy, harn_cln, harn_gar, harn_m2, harn_s_m, human_m, narn, dever_m, elves_d, elves_n, felana, harn_f2, harn_k_f, harn_m, hobbits, inns, orcs_t, dragon, elves_f, elves_t, general, harn_f, harn_k_m, harn_s_f, human_f, items, orcs_wh, wc_tribes, wc_cats")
return
if inp == "all":
modules = all_modules
else:
if inp:
modules = inp.split(' ')
else:
modules = ["human_m", "human_f"]
for module in modules:
if module in all_modules:

View file

@ -4,47 +4,110 @@ import time
from util import hook
def format_quote(q, num, n_quotes):
"""Returns a formatted string of a quote"""
ctime, nick, msg = q
return "[%d/%d] <%s> %s" % (num, n_quotes,
nick, msg)
def create_table_if_not_exists(db):
"""Creates an empty quote table if one does not already exist"""
db.execute('''CREATE TABLE IF NOT EXISTS quote (
chan,
nick,
add_nick,
msg,
time real,
deleted default 0,
PRIMARY KEY (chan, nick, msg)
)''')
db.commit()
def add_quote(db, chan, nick, add_nick, msg):
db.execute('''insert or fail into quote (chan, nick, add_nick,
msg, time) values(?,?,?,?,?)''',
(chan, nick, add_nick, msg, time.time()))
db.commit()
"""Adds a quote to a nick, returns message string"""
try:
db.execute('''INSERT OR FAIL INTO quote
(chan, nick, add_nick, msg, time)
VALUES(?,?,?,?,?)''',
(chan, nick, add_nick, msg, time.time()))
db.commit()
except db.IntegrityError:
return "message already stored, doing nothing."
return "quote added."
def del_quote(db, chan, nick, add_nick, msg):
db.execute('''update quote set deleted = 1 where
chan=? and lower(nick)=lower(?) and msg=msg''')
"""Deletes a quote from a nick"""
db.execute('''UPDATE quote
SET deleted = 1
WHERE chan=?
AND lower(nick)=lower(?)
AND msg=msg''')
db.commit()
def get_quote_num(num, count, name):
"""Returns the quote number desired from the database"""
if num: # Make sure num is a number if it isn't false
num = int(num)
if count == 0: # If there are no quotes in the database, raise an Exception.
raise Exception("No quotes found for %s" % name)
if num and num < 0: # If the selected quote is less than 0, count back if possible.
num = count + num + 1 if num + count > -1 else count + 1
if num and num > count: # If a number is given and and there are not enough quotes, raise an Exception.
raise Exception("I only have %d quote%s for %s" % (count, ('s', '')[count == 1], name))
if num and num == 0: # If the number is zero, set it to one
num = 1
if not num: # If a number is not given, select a random one
num = random.randint(1, count)
return num
def get_quotes_by_nick(db, chan, nick):
return db.execute("select time, nick, msg from quote where deleted!=1 "
"and chan=? and lower(nick)=lower(?) order by time",
(chan, nick)).fetchall()
def get_quote_by_nick(db, chan, nick, num=False):
"""Returns a formatted quote from a nick, random or selected by number"""
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
AND chan = ?
AND lower(nick) = lower(?)''', (chan, nick)).fetchall()[0][0]
try:
num = get_quote_num(num, count, nick)
except Exception as error_message:
return error_message
def get_quotes_by_chan(db, chan):
return db.execute("select time, nick, msg from quote where deleted!=1 "
"and chan=? order by time", (chan,)).fetchall()
quote = db.execute('''SELECT time, nick, msg
FROM quote
WHERE deleted != 1
AND chan = ?
AND lower(nick) = lower(?)
ORDER BY time
LIMIT ?, 1''', (chan, nick, (num-1))).fetchall()[0]
return format_quote(quote, num, count)
def get_quote_by_chan(db, chan, num=False):
"""Returns a formatted quote from a channel, random or selected by number"""
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
AND chan = ?''', (chan,)).fetchall()[0][0]
def format_quote(q, num, n_quotes):
ctime, nick, msg = q
return "[%d/%d] %s <%s> %s" % (num, n_quotes,
time.strftime("%Y-%m-%d", time.gmtime(ctime)), nick, msg)
try:
num = get_quote_num(num, count, chan)
except Exception as error_message:
return error_message
quote = db.execute('''SELECT time, nick, msg
FROM quote
WHERE deleted != 1
AND chan = ?
ORDER BY time
LIMIT ?, 1''', (chan, (num -1))).fetchall()[0]
return format_quote(quote, num, count)
@hook.command('q')
@hook.command
def quote(inp, nick='', chan='', db=None):
".q/.quote [#chan] [nick] [#n]/.quote add <nick> <msg> -- gets " \
"random or [#n]th quote by <nick> or from <#chan>/adds quote"
db.execute("create table if not exists quote"
"(chan, nick, add_nick, msg, time real, deleted default 0, "
"primary key (chan, nick, msg))")
db.commit()
create_table_if_not_exists(db)
add = re.match(r"add[^\w@]+(\S+?)>?\s+(.*)", inp, re.I)
retrieve = re.match(r"(\S+)(?:\s+#?(-?\d+))?$", inp)
@ -52,47 +115,16 @@ def quote(inp, nick='', chan='', db=None):
if add:
quoted_nick, msg = add.groups()
try:
add_quote(db, chan, quoted_nick, nick, msg)
db.commit()
except db.IntegrityError:
return "message already stored, doing nothing."
return "quote added."
return add_quote(db, chan, quoted_nick, nick, msg)
elif retrieve:
select, num = retrieve.groups()
by_chan = False
if select.startswith('#'):
by_chan = True
quotes = get_quotes_by_chan(db, select)
by_chan = True if select.startswith('#') else False
if by_chan:
return get_quote_by_chan(db, select, num)
else:
quotes = get_quotes_by_nick(db, chan, select)
return get_quote_by_nick(db, chan, select, num)
elif retrieve_chan:
chan, nick, num = retrieve_chan.groups()
quotes = get_quotes_by_nick(db, chan, nick)
else:
return quote.__doc__
n_quotes = len(quotes)
if not n_quotes:
return "no quotes found"
if num:
num = int(num)
if num:
if num > n_quotes or (num < 0 and num < -n_quotes):
return "I only have %d quote%s for %s" % (n_quotes,
('s', '')[n_quotes == 1], select)
elif num < 0:
selected_quote = quotes[num]
num = n_quotes + num + 1
else:
selected_quote = quotes[num - 1]
else:
num = random.randint(1, n_quotes)
selected_quote = quotes[num - 1]
return format_quote(selected_quote, num, n_quotes)
return get_quote_by_nick(db, chan, nick, num)
return quote.__doc__

View file

@ -17,6 +17,5 @@ def sloganizr(inp, nick=None, say=None, input=None):
slogan = slogan.split()
slogan[0] = slogan[0].capitalize()
slogan = " ".join(slogan)
return slogan
return slogan

23
plugins/spellcheck.py Normal file
View file

@ -0,0 +1,23 @@
import re
from util import hook
import enchant
@hook.command("spellcheck")
def spell(inp):
'''.time <area> -- gets the time in <area>'''
d = enchant.Dict("en_US")
if not (inp.split()[-1] == inp):
return "This command only supports one word at a time."
is_correct = d.check(inp)
suggestions = d.suggest(inp)
s_string = ', '.join(suggestions)
if is_correct:
return "That word appears to be valid! (suggestions: " + s_string + ")"
else:
return "That word appears to be invalid! (suggestions: " + s_string + ")"

View file

@ -31,6 +31,7 @@ def tellinput(paraml, input=None, db=None, bot=None):
db_init(db)
tells = get_tells(db, input.nick)
if tells:
@ -73,11 +74,11 @@ def showtells(inp, nick='', chan='', notice=None, db=None):
@hook.command
def tell(inp, nick='', chan='', db=None, input=None, notice=None):
".tell <nick> <message> -- relay <message> to <nick> when <nick> is around"
query = inp.split(' ', 1)
if len(query) != 2:
return tell.__doc__
notice(tell.__doc__)
return
user_to = query[0].lower()
message = query[1].strip()
@ -87,7 +88,7 @@ def tell(inp, nick='', chan='', db=None, input=None, notice=None):
chan = 'a pm'
if user_to == user_from.lower():
notice("No.")
notice("No. I'm not doing that. -.-")
return
if user_to.lower() == "mau5bot":

View file

@ -61,6 +61,7 @@ def translate(inp):
'.translate [source language [target language]] <sentence> -- translates' \
' <sentence> from source language (default autodetect) to target' \
' language (default English) using Google Translate'
return "Due to Google deprecating the translation API, this command is no longer available :("
args = inp.split(' ', 2)
@ -96,6 +97,7 @@ def babel_gen(inp):
@hook.command
def babel(inp):
".babel <sentence> -- translates <sentence> through multiple languages"
return "Due to Google deprecating the translation API, this command is no longer available :("
try:
return list(babel_gen(inp))[-1][2]
@ -107,6 +109,8 @@ def babel(inp):
def babelext(inp):
".babelext <sentence> -- like .babel, but with more detailed output"
return "Due to Google deprecating the translation API, this command is no longer available :("
try:
babels = list(babel_gen(inp))
except IOError, e:

View file

@ -1,6 +1,6 @@
"""
TV information, written by Lurchington 2010
modified by rmmh 2010 && lukeroge 2011
modified by rmmh 2010
"""
import datetime
@ -13,6 +13,7 @@ from util import hook, http
base_url = "http://thetvdb.com/api/"
api_key = "469B73127CA0C411"
def get_zipped_xml(*args, **kwargs):
@ -24,19 +25,19 @@ def get_zipped_xml(*args, **kwargs):
return etree.parse(ZipFile(zip_buffer, "r").open(path))
def get_episodes_for_series(seriesname, api_key):
def get_episodes_for_series(seriesname):
res = {"error": None, "ended": False, "episodes": None, "name": None}
# http://thetvdb.com/wiki/index.php/API:GetSeries
try:
query = http.get_xml(base_url + 'GetSeries.php', seriesname=seriesname)
except URLError:
res["error"] = "Error contacting thetvdb.com."
res["error"] = "error contacting thetvdb.com"
return res
series_id = query.xpath('//seriesid/text()')
if not series_id:
res["error"] = "Unknown TV series (using www.thetvdb.com)."
res["error"] = "unknown tv series (using www.thetvdb.com)"
return res
series_id = series_id[0]
@ -45,7 +46,7 @@ def get_episodes_for_series(seriesname, api_key):
series = get_zipped_xml(base_url + '%s/series/%s/all/en.zip' %
(api_key, series_id), path="en.xml")
except URLError:
res["error"] = "Error contacting thetvdb.com."
res["error"] = "error contacting thetvdb.com"
return res
series_name = series.xpath('//SeriesName/text()')[0]
@ -83,11 +84,9 @@ def get_episode_info(episode):
@hook.command
@hook.command('tv')
def tv_next(inp, bot = None):
def tv_next(inp):
".tv_next <series> -- get the next episode of <series>"
api_key = bot.config["api_keys"]["tvdb"]
episodes = get_episodes_for_series(inp, api_key)
episodes = get_episodes_for_series(inp)
if episodes["error"]:
return episodes["error"]
@ -120,22 +119,20 @@ def tv_next(inp, bot = None):
break
if not next_eps:
return "There are no new episodes scheduled for %s." % series_name
return "there are no new episodes scheduled for %s" % series_name
if len(next_eps) == 1:
return "The next episode of %s airs %s." % (series_name, next_eps[0])
return "the next episode of %s airs %s" % (series_name, next_eps[0])
else:
next_eps = ', '.join(next_eps)
return "The next episodes of %s: %s." % (series_name, next_eps)
return "the next episodes of %s: %s" % (series_name, next_eps)
@hook.command
@hook.command('tv_prev')
def tv_last(inp, bot = None):
def tv_last(inp):
".tv_last <series> -- gets the most recently aired episode of <series>"
api_key = bot.config["api_keys"]["tvdb"]
episodes = get_episodes_for_series(inp, api_key)
episodes = get_episodes_for_series(inp)
if episodes["error"]:
return episodes["error"]

View file

@ -61,10 +61,10 @@ def format_reply(history):
return #"that url has been posted %s in the past %s by %s (%s)." % (ordinal,
@hook.regex(r'([a-zA-Z]+://|www\.)[^ ]+')
def urlinput(match, nick='', chan='', db=None, bot=None):
@hook.command
def url(inp, nick='', chan='', db=None, bot=None):
db_init(db)
url = urlnorm.normalize(match.group().encode('utf-8'))
url = urlnorm.normalize(inp.group().encode('utf-8'))
if url not in ignored_urls:
url = url.decode('utf-8')
history = get_history(db, chan, url)

View file

@ -4,7 +4,7 @@ from urllib2 import urlopen, Request, HTTPError
import re
import BeautifulSoup
ignored_urls = ["http://google.com","http://youtube.com","http://pastebin.com","http://mibpaste.com","http://fpaste.com"]
ignored_urls = ["http://google.com","http://youtube.com","http://pastebin.com","http://mibpaste.com","http://fpaste.com","beastnode.com"]
wordDic = {
'&#34;': '"',
@ -41,7 +41,7 @@ def multiwordReplace(text, wordDic):
#@hook.regex(r'^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$')
@hook.regex(r'([a-zA-Z]+://|www\.)[^ ]+')
#@hook.regex(r'([a-zA-Z]+://|www\.)[^ ]+')
def urlparser(match, say = None):
print "[debug] URL found"
url = urlnorm.normalize(match.group().encode('utf-8'))

3
plugins/util/molecular.py Executable file → Normal file
View file

@ -74,7 +74,7 @@ __version__ = "1.0"
import string, re, sys, random
NAMEDIR = "./namefiles/"
NAMEDIR = "/home/ircbot/bot/plugins/util/names"
NAMESECTIONS = [ "inf", "first", "mid", "final", "notes", "end" ]
class NameFile:
@ -217,4 +217,3 @@ if __name__ == "__main__":
for i in range(n):
print name.name()
i += 1

View file

@ -0,0 +1,30 @@
felana.nam Felana (feline) names by Nathalie Hebert
dever_f.nam Deverry female names, namefile by Johan Danforth.
dever_m.nam Deverry male names, namefile by Johan Danforth
dragon.nam Dragon names, namefile by Brett Slocum
dwarves.nam Dwarven names, namefile by Johan Danforth
elves_d.nam Deverry elven names, namefile by Johan Danforth
elves_f.nam Elven female names, namefile by Johan Danforth
elves_m.nam Elven male names, namefile by Johan Danforth
elves_n.nam Nevermore elven surnames, namefile by Chris Gonnerman
elves_t.nam Tolkien elven names, namefile by Johan Danforth
fantasy.nam General fantasy names, namefile by Brett Slocum
general.nam Common fantasy names, namefile by Johan Danforth
harn_cln.nam H&acirc;rnic clan (last) names
harn_f.nam H&acirc;rnic female names
harn_f2.nam H&acirc;rnic female names (simplified)
harn_gar.nam Gargun names
harn_k_f.nam Khuzdul female names
harn_k_m.nam Khuzdul male names
harn_m.nam H&acirc;rnic male names
harn_m2.nam H&acirc;rnic male names (simplified)
harn_s_f.nam Sindarin female names
harn_s_m.nam Sindarin male names
hobbits.nam Tolkien hobbit names, namefile by Johan Danforth
human_f.nam Female names (fantasy), namefile by Johan Danforth
human_m.nam Male names (fantasy), namefile by Johan Danforth
inns.nam Inn/Tavern/Bar/Pub Names
items.nam Item names
orcs_t.nam Tolkien orc names by Johan Danforth and Tobias Petersson
orcs_wh.nam Warhammer orc names, namefile by Johan Danforth and Tobias Petersson
narn.nam Babylon 5 Narn names by Kevin G. Nunn

View file

@ -0,0 +1,30 @@
felana.nam Felana (feline) names by Nathalie Hebert
dever_f.nam Deverry female names, namefile by Johan Danforth.
dever_m.nam Deverry male names, namefile by Johan Danforth
dragon.nam Dragon names, namefile by Brett Slocum
dwarves.nam Dwarven names, namefile by Johan Danforth
elves_d.nam Deverry elven names, namefile by Johan Danforth
elves_f.nam Elven female names, namefile by Johan Danforth
elves_m.nam Elven male names, namefile by Johan Danforth
elves_n.nam Nevermore elven surnames, namefile by Chris Gonnerman
elves_t.nam Tolkien elven names, namefile by Johan Danforth
fantasy.nam General fantasy names, namefile by Brett Slocum
general.nam Common fantasy names, namefile by Johan Danforth
harn_cln.nam H&acirc;rnic clan (last) names
harn_f.nam H&acirc;rnic female names
harn_f2.nam H&acirc;rnic female names (simplified)
harn_gar.nam Gargun names
harn_k_f.nam Khuzdul female names
harn_k_m.nam Khuzdul male names
harn_m.nam H&acirc;rnic male names
harn_m2.nam H&acirc;rnic male names (simplified)
harn_s_f.nam Sindarin female names
harn_s_m.nam Sindarin male names
hobbits.nam Tolkien hobbit names, namefile by Johan Danforth
human_f.nam Female names (fantasy), namefile by Johan Danforth
human_m.nam Male names (fantasy), namefile by Johan Danforth
inns.nam Inn/Tavern/Bar/Pub Names
items.nam Item names
orcs_t.nam Tolkien orc names by Johan Danforth and Tobias Petersson
orcs_wh.nam Warhammer orc names, namefile by Johan Danforth and Tobias Petersson
narn.nam Babylon 5 Narn names by Kevin G. Nunn

View file

@ -0,0 +1,48 @@
[inf]
Deverry female names, namefile by Johan Danforth.
Edited by Arkhan.
[first]
Al
Br
C
Cl
D
El
Gw
J
L
M
N
Mer
S
R
Ys
[mid]
a
ae
e
ea
i
o
u
y
w
[final]
brylla
cla
dda
ll
lla
llyra
lonna
lyan
na
ngwen
niver
noic
ra
rka
ryan
ssa
vyan
[end]

View file

@ -0,0 +1,54 @@
[inf]
Deverry male names, namefile by Johan Danforth
Edited by Arkhan
[first]
Aeth
Addr
Bl
C
Car
D
G
Gl
Gw
L
M
Ow
R
Rh
S
T
V
Yr
[mid]
a
ae
e
eo
i
o
u
y
[final]
bryn
c
cyn
dd
ddry
ddyn
doc
dry
gwyn
llyn
myr
n
nnyn
nry
nvan
nyc
r
rcyn
rraent
ran
ryn
[end]

View file

@ -0,0 +1,161 @@
[inf]
Dragon names, namefile by Brett Slocum
[first]
Aelf
Aelb
Aethel
Aedil
Badu
Beado
Beo
Blith
Bregu
Ceol
Ceon
Coin
Cene
Cuth
Cud
Cwic
Cuic
Quic
Dryct
Dryht
Ead
Ed
Aead
Eald
Ald
Ealh
Alh
Earcon
Ercon
Earn
Ecg
Ec
Eofor
Eorcon
Eormen
Yrmen
Folc
Ford
Fri
Gold
Grim
Haem
Haeth
Heah
Healf
Hreth
Hroth
Huaet
Hyg
Hugu
Iaru
Leof
Maegen
Oidil
Ongen
Os
Rath
Saex
Sax
Sex
Sele
Tat
Theod
Til
Torct
Trum
Tun
Waeg
Wig
Wil
[mid]
[final]
bald
beald
balt
balth
beorht
berct
berict
beorn
bern
brand
broad
burg
burh
cyni
cyn
degn
ferth
flaed
fled
for
frith
frit
frid
gar
geld
gifu
geofu
gisl
gund
gunn
gyth
gyd
haed
hathu
heard
hard
here
heri
helm
hild
hun
lac
laf
lid
lind
linda
maer
man
mon
mund
noth
raed
red
refu
ric
sig
sige
stan
swith
swid
theof
theow
thryth
thryd
wealch
walh
weald
wald
weard
ward
wic
wict
wiht
wine
wini
wiw
wiv
wuda
wida
wudu
wulf
ulf
wyn
wynn
[end]

View file

@ -0,0 +1,43 @@
[inf]
Dwarven names, namefile by Johan Danforth
Edited by Arkhan
[first]
B
D
F
G
Gl
H
K
L
M
N
R
S
T
V
[mid]
a
e
i
o
oi
u
[final]
bur
fur
gan
gnus
gnar
li
lin
lir
mli
nar
nus
rin
ran
sin
sil
sur
[end]

View file

@ -0,0 +1,93 @@
[inf]
Deverry elven names, namefile by Johan Danforth
Edited by Arkhan
[first]
Ad
Adr
Al
Alb
Alod
Ann
B
Ban
Ber
Cal
Car
Carr
Cont
Dall
Dar
Dev
Eb
El
Elb
En
Far
Gann
Gav
Hal
Jav
Jenn
L
Land
Man
Mer
Nan
Ran
Tal
Tal
Val
Wyl
[mid]
a
a
abe
abri
ae
ae
ala
alae
ale
ama
amae
ana
e
e
ede
ena
ere
o
oba
obre
[final]
beriel
clya
danten
dar
ddlaen
gyn
ladar
ldar
lden
lia
mario
na
ndar
ndario
nderiel
ndra
nnon
nna
ntar
ntariel
nteriel
ny
raen
rel
ria
riel
ryn
ssi
teriel
ver
[end]

View file

@ -0,0 +1,74 @@
[inf]
Elven female names, namefile by Johan Danforth
Edited by Arkhan
[first]
An
Am
Bel
Cel
C
Cal
Del
El
Elr
Elv
Eow
Ear
F
G
Gal
Gl
H
Is
Leg
Lem
M
N
P
R
S
T
Thr
Tin
Ur
Un
V
[mid]
a
a
adrie
ara
e
e
ebri
i
io
ithra
ilma
il-Ga
o
orfi
o
u
y
[final]
clya
lindi
di
dien
dith
dia
lith
lia
ndra
ng
nia
niel
rith
thien
thiel
viel
wen
wien
wiel
[end]

View file

@ -0,0 +1,75 @@
[inf]
Elven male names, namefile by Johan Danforth
Edited by Arkhan
[first]
An
Am
Bel
Cel
C
Cal
Del
El
Elr
Elv
Eow
Ear
F
G
Gal
Gl
H
Is
Leg
Lem
M
N
P
R
S
T
Thr
Tin
Ur
Un
V
[mid]
a
a
adrie
ara
e
e
ebri
i
io
ithra
ilma
il-Ga
o
orfi
o
u
y
[final]
l
las
lad
ldor
ldur
lith
mir
n
nd
ndel
ndil
ndir
nduil
ng
mbor
r
ril
riand
rion
wyn
[end]

View file

@ -0,0 +1,50 @@
[inf]
Nevermore elven surnames, namefile by Chris Gonnerman
[first]
Amara-
Bara-
Cora-
Dano-
Eura-
Fori-
Gora-
Hana-
Iaru-
Joro-
Kira-
Lana-
Mara-
Mira-
Nura-
Oro-
Palo-
Quara-
Rago-
Sana-
Taru-
Ulo-
Vana-
Wiro-
Yanu-
Yira-
Yalo-
Zoma-
[mid]
weah-
wor-
lora-
taum-
zea-
ro-
[final]
sigvd
augal
thanal
shanda
tanal
zand
[notes]
The High Elves of Nevermore never write their names with punctuation
between the parts, so the dashes here are improper, but they help
immensely with pronunciation.
[end]

View file

@ -0,0 +1,69 @@
[inf]
Tolkien elven names, namefile by Johan Danforth
Edited by Arkhan
[first]
An
Bel
Cel
El
Elr
Elv
Eow
Ear
F
G
Gal
Gl
Is
Leg
Lem
N
S
T
Thr
Tin
[mid]
a
a
adrie
ara
e
e
ebri
i
io
ithra
ilma
il-Ga
o
orfi
o
u
y
[final]
l
las
lad
ldor
ldur
lindo
lith
mir
n
nd
ndel
ndil
ndir
nduil
ng
mbor
r
rith
ril
riand
rion
thien
viel
wen
wyn
[end]

View file

@ -0,0 +1,542 @@
[inf]
General fantasy names, namefile by Brett Slocum
[first]
Ral
Na
Ard
Vald
Cal
Hy
Pan
Chies
Per
Er
Hob
Harg
Win
Mar
Quarne
Ba
Er
Odas
Ka
Mold
Syn
Ro
Jast
Yal
Nap
Vard
As
Binthe
Zald
Dez
Las
Uld
Nev
Haur
Bar
Das
Ty
Dar
Ost
Tral
Grave
Eth
Flar
Yal
Klab
Harab
Jar
Nor
Dain
Toc
Bay
Haith
Cal
Lar
Naut
Druc
Bar
Art
For
Mart
Yar
Ha
Ny
Yar
Verd
Wy
Plag
Ter
Haur
Var
Ar
Dar
Val
Mar
Car
Loc
Wearn
Dras
Bel
Har
Jar
For
Kil
Oc
Al
Skal
Nun
Az
Kop
Houl
Lab
Jar
Vast
Claune
Tes
Ob
Nist
El
Est
Zol
Brow
Pulg
Star
Kren
Crac
Scaun
Wal
Quer
Ry
Cyn
Rusk
Del
Lab
Mel
Sep
Lor
Ros
Jar
Daf
Hal
Kol
In
Ael
Sald
Kuv
Ym
Ca
Keld
Bar
Tarl
Shot
Pes
Quer
Lor
Geld
Ar
Har
Bae
Vad
Pas
Ur
Nor
Kir
Var
Mel
Ar
Shy
I
Rald
Cor
Sar
Kor
Rol
Har
Ash
Dir
Las
Vab
Ald
Par
Ob
Hor
Chy
Jar
Ryle
Char
Hab
Sar
Vart
Nist
Obr
Jar
Ge
Yas
Pav
Jes
Shot
Mar
Hor
Er
Ki
Har
Cal
And
[mid]
gur
carn
az
acy
ayn
asc
gary
hen
tan
arny
alen
carth
gant
rath
cam
art
ron
arth
arth
carad
ere
geth
aldy
yn
valer
arne
aller
varn
ar
an
nal
tyne
ar
art
ont
aur
aver
lyn
as
gar
cuth
arry
or
quine
astar
mel
aryn
art
war
asty
zane
arik
ayne
loc
oller
warty
aryne
chean
quin
tar
dar
reth
ant
an
yne
ax
tuny
wat
juin
a
gayn
on
an
car
gine
codd
quent
eas
ew
azer
am
ly
stead
orn
ar
cath
iera
que
air
la
art
erry
end
om
ast
et
arty
doth
cath
ert
dy
orn
ont
tak
ar
art
warne
arn
in
ian
el
ak
il
ydd
ime
yn
en
in
im
el
ar
ro
is
is
ro
era
ene
in
ane
iam
ain
ir
un
il
bin
lin
is
sene
bin
lir
ame
a
fyn
y
in
yd
ien
ain
yn
ar
er
in
sume
ras
id
mel
luth
ance
er
yn
an
ar
ayne
eth
len
ter
rik
er
ro
tin
mel
yn
ris
lene
ane
as
[final]
ty
carn
ar
acy
er
al
gary
y
ar
arny
alen
carth
gant
y
ber
art
dal
arth
arth
an
ere
geth
aldy
yn
valer
arne
aller
varn
ayne
an
nal
tyne
ayne
art
ont
ney
aver
lyn
iel
gar
y
arry
or
quine
astar
er
aryn
art
war
asty
zane
arik
ayne
an
oller
warty
aryne
chean
ta
un
tha
reth
ant
el
yne
el
tuny
wat
juin
dor
gayn
tyn
dar
car
gine
codd
quent
eas
ew
azer
ont
ly
stead
orn
en
cath
iera
que
air
la
art
erry
sa
ar
er
ern
arty
doth
y
ert
dy
orn
ont
ern
ayn
art
warne
arn
in
ian
el
ak
il
ydd
ime
yn
en
in
im
el
ar
ro
is
is
ro
era
ene
in
ane
iam
ain
ir
un
il
bin
lin
is
sene
bin
lir
ame
a
fyn
se
in
yd
ien
ain
yn
ar
er
in
sume
ras
on
mel
luth
ance
er
yn
an
ar
ayne
eth
nyd
ter
rik
nik
ro
a
mel
yn
ris
lene
ane
yr
[end]

View file

@ -0,0 +1,118 @@
[inf]
Felana (feline) names by Nathalie Hebert
[first]
Am
An
As
Ash
Ast
C
Chen
Chan
Char
Cher
Cer
Es
Esh
Is
Ish
Os
Osh
Us
Ush
Ys
Ysh
H
Ch
S
Shen
Sar
Sol
Shar
Shan
Sher
Shim
Sim
Sin
San
Sar
Ser
Sor
Shor
Sham
Sh
[mid]
a
ar
as
e
es
i
is
o
os
u
us
y
ys
er
or
ur
yr
ir
eri
ari
osh
ash
esh
ish
ush
ysh
en
an
in
on
un
yn
[final]
dar
mir
nir
nor
nar
ish
ash
osh
esh
isha
asha
esha
osha
orsha
a
e
i
o
u
y
sar
ser
sor
sir
der
sham
shor
shen
as
es
ys
seth
san
sin
sil
sur
sen
sean
dor
[end]

View file

@ -0,0 +1,195 @@
[inf]
Common fantasy names, namefile by Johan Danforth
Edited by Arkhan
[first]
A
Ab
Ac
Ad
Af
Agr
Ast
As
Al
Adw
Adr
Ar
B
Br
C
C
C
Cr
Ch
Cad
D
Dr
Dw
Ed
Eth
Et
Er
El
Eow
F
Fr
G
Gr
Gw
Gw
Gal
Gl
H
Ha
Ib
Jer
K
Ka
Ked
L
Loth
Lar
Leg
M
Mir
N
Nyd
Ol
Oc
On
P
Pr
R
Rh
S
Sev
T
Tr
Th
Th
V
Y
Yb
Z
W
W
Wic
[mid]
a
ae
ae
au
ao
are
ale
ali
ay
ardo
e
ei
ea
ea
eri
era
ela
eli
enda
erra
i
ia
ie
ire
ira
ila
ili
ira
igo
o
oa
oi
oe
ore
u
y
[final]
a
and
b
bwyn
baen
bard
c
ctred
cred
ch
can
d
dan
don
der
dric
dfrid
dus
f
g
gord
gan
l
li
lgrin
lin
lith
lath
loth
ld
ldric
ldan
m
mas
mos
mar
mond
n
nydd
nidd
nnon
nwan
nyth
nad
nn
nnor
nd
p
r
ron
rd
s
sh
seth
sean
t
th
th
tha
tlan
trem
tram
v
vudd
w
wan
win
win
wyn
wyn
wyr
wyr
wyth
[end]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,208 @@
[inf]
H&acirc;rnic female names
By Kimmo &quot;Arkhan&quot; Kulovesi, based on the H&acirc;rn names list
[first]
A
Aaln
Al
Al
Am
Ann
Ap
Ash
Benl
Cel
Cyb
D
D
E
E
El
El
Elw
Ev
Evl
Ew
F
Fal
Fel
Gw
I
Iv
In
J
Jinl
Jud
L
L
L
Lem
Lyc
Lynd
Lyn
Lys
M
Mel
Meln
Min
N
Nin
Nil
Quen
Q
Q
S
S
S
Sen
Sh
Sus
Sys
Tes
Th
Uw
Un
Vel
Ven
Wel
Wen
Wend
Y
Y
Y
Yl
Yv
[mid]
a
a
a
aa
ae
ae
ae
ae
aly
aya
e
e
e
e
ea
ea
elae
eni
ey
i
i
i
i
ia
ia
ia
ie
ila
o
oi
u
u
ue
ui
y
y
y
y
y
[final]
bael
da
da
de
deil
dia
diene
dre
dyen
e
fe
ga
hnia
l
l
l
l
la
la
la
lawn
lda
le
le
le
lea
lea
len
lene
leryn
lice
lila
lime
lina
lina
line
lise
lith
lla
lla
lya
lyn
lyne
lyne
lyth
ma
mlen
n
n
n
n
na
na
na
na
nde
ne
ne
ne
ne
nea
nela
nele
nia
nian
nila
nis
nne
nshea
rien
s
sa
sa
sale
se
se
se
sea
sla
sna
son
sse
ssea
sye
syn
syne
ta
ta
thine
thyle
tte
[end]

View file

@ -0,0 +1,84 @@
[inf]
H&acirc;rnic female names (simplified)
[first]
A
Ali
Amo
Be
Bi
Da
Div
E
Er
Fan
Fem
Fil
Hal
Hen
His
Sa
Sin
Sun
I
Inu
Lan
Lin
Nav
Nim
Rel
Rev
Tan
Tiv
Tus
[mid]
a
an
ea
ef
fa
hi
la
le
lo
ma
mi
n
na
ni
no
ra
ri
sa
si
ta
ti
tu
[final]
a
ama
an
ana
bia
ea
em
ess
da
dia
dim
in
ina
ma
mia
na
ne
ona
ola
ra
ria
ta
tia
tena
una
ua
via
[end]

View file

@ -0,0 +1,92 @@
[inf]
Gargun names
[first]
Ak
Ar
Da
Du
Di
Er
Es
Fe
Fi
Ge
Gi
He
Hi
Ich
Il
In
Is
Ka
Ke
Kh
Kha
Khe
Le
Li
Me
Mu
Ok
Ov
Op
Os
Re
Ri
Ry
Ta
Th
Ti
Uk
Us
Za
Ze
Zch
[mid]
'de
'im
'le
'ut
as
at
be
az
ad
de
dez
ea
eh
ev
e
i
in
ki
li
ma
mak
r
u
ux
v
[final]
ak
as
ad
am
ek
er
ef
fez
fak
fuk
ik
ot
rt
rik
tek
uch
ulk
uk
ur
urk
[end]

View file

@ -0,0 +1,81 @@
[inf]
Khuzdul female names
By Kimmo &quot;Arkhan&quot; Kulovesi, based on the H&acirc;rn names list
[first]
Ali
Amo
Be
Bi
Da
Div
Fan
Fem
Fil
Hal
Hen
His
Sa
Sin
Sun
Inu
Lan
Lin
Nav
Nim
Rel
Rev
Tan
Tiv
Tus
[mid]
a
an
ea
ef
fa
hi
la
le
lo
ma
mi
n
na
ni
no
ra
ri
sa
si
ta
ti
tu
[final]
a
ama
an
ana
bia
ea
em
ess
da
dia
dim
in
ina
ma
mia
na
ne
ona
ola
ra
ria
ta
tia
tena
una
ua
via
[end]

View file

@ -0,0 +1,98 @@
[inf]
Khuzdul male names
[first]
An
Ak
Al
Da
Der
Du
Di
Eve
En
Er
Es
Fa
Fe
Fi
Ga
Ge
Gem
Gi
Ha
He
Hi
Il
In
Is
Ka
Ke
Kh
Kha
Khe
La
Le
Li
Lo
Ma
Me
Ob
Ov
Op
Os
Ra
Re
Ri
Ry
Ta
Te
Th
Ti
Us
Uv
Za
Ze
[mid]
as
at
be
daz
d
de
dez
ea
eh
he
i
in
ki
li
ma
mak
r
u
v
[final]
ain
ais
ard
as
dan
el
er
ef
f
fam
fus
ik
im
ol
ot
rt
ri
tan
te
tel
ulm
ur
[end]

View file

@ -0,0 +1,724 @@
[inf]
H&acirc;rnic male names
By Kimmo &quot;Arkhan&quot; Kulovesi, based on the H&acirc;rn names list
[first]
Aad
Ab
Ad
Aer
Agl
Aidr
Aikr
Ail
Akat
Al
Alar
Alas
Alb
Ald
Aleg
Alh
Alor
Als
Alw
Am
Amer
Anafl
And
Anfl
Anr
Ans
Anv
Ar
Ar
Ar
Arb
Ard
Arl
Arm
Art
Arv
Arvj
Arw
As
Ash
Ash-K'v
Asl
Ast
Ast
At
Atam
Av
Aym
Azik
B
Bak
Bal
Bals
Balw
Bar
Bar
Bas
Ber
Ber
Bes
Bir
Birn
Bj
Bogn
Bor
Br
Br
Bratw
Brish
Brix
Bulw
Bur
Burk
Byrg
Caad
Cabr
Cael
Caem
Cal
Car
Caz
Cer
Ch
Ch
Chaf
Chaf
Chalm
Char
Char
Charid
Chr
Chun
Chun-J
Cl
Clem
Cliv
Cob
Col
Cor
Corb
Corf
Corn
Corth
Cras
Crest
Criss
Crol
Crow
Cud
Cyz
D
D
D
D
Dabl
Daf
Dag
Dal
Dalf
Daq
Darl
Dr
Dur
Durg
Dus
Dw
Dyr
Dys
Eaf
Eam
Eaw
Eb
El
Embr
End
Eoch
Eph
Er
Erc
Erd
Erg
Ern
Es
Esc
Et
Ev
Ew
Ez
F
F
Farg
Feb
Fel
Felj
Fer
Ferg
Fod
Fol
For
Fr
Fyn
G
G
Gar
Garr
Gath
Gebr
Gen
Ger
Gors
Gosh
Gr
Graz
Gun
Gw
H
H
Had
Hag
Hak
Hal
Hals
Ham
Han
Hantr
Hanus
Har
Harq
Hars
Havr
Hel
Hem
Her
Herm
Herp
Hest
Het
Hj
Hor
Horb
Hord
Hrak'
Hub
Ikar
Imad
Ind
Indr
Ir
Ird
Is
J
Ja-
Jan
Jarl
Jebr
Jel
Jenk
Jerd
Jethr
Jith
Josr
Julw
K
Kal
Kalv
Kam
Kar
Kard
Karn
Kas
Kasv
Kath
Keftr
Keir
Keld
Ker
Kil
Kl
Kor
Korb
Korg
Kv
Labr
Lak
Leb
Led
Ledr
Lelpr
Lenp
Lesc
Lin
Ll
Llast
Lon
Lor
Lorg
Lorq
Lud
Lum
Lynd
M
Mabr
Mal
Mald
Man
Mar
Mard
Mart
Marv
Matt
Meam
Medr
Mej
Mel
Mels
Melv
Mer
Merd
Mers
Mert
Merw
Mest
Meth
Methg
Mig
Mindr
Minz
Mir
Mokr
Mord
Morg
Mort
Musq
Myrn
Myrv
Nak
Nem
Nens
Ner
Nor
Norb
Olv
Op
Ord
Orh
Orman
Ort
Orth
Orv
Osth
Ov
P
Pl
Pr
Q
Quer
R
Ran
Rath
Rem
Ric
Rik
Rith
Rogr
S
Sal
Sar
Sar
Saur
Saur
Ser
Sh
Sor
Sorl
Sors
St
Sw
Syth
T
T
Tabr
Taeb
Taeldl
Tag
Tagb
Talb
Talv
Tam
Tamr
Tar
Tar
Tard
Tarv
Ter
Terr
Tev
Tez
Th
Tib
Tierg
Tog
Tol
Ton
Tor
Torbr
Torr
Tot
Tr
Treg
Tugr
Tur
Turg
Turv
Tuz
Tuzr
Tyar
Tyk
Tyr
Ul
Uld
Um
Un
Und
Urbr
Urien
Uth
Uthr
V
Val
Valh
Var
Vard
Varin
Vjald
Vl
Vor
Vorg
Vr
Vul
Vund
Vur
Vurk
Warn
Welr
Weltr
Wer
Wid
Wil
Work
Wyr
X
Xeld
Yald
Yarbr
Yard
Yarn
Ydr
Yeb
Yer
Yev
Yig
Yol
Yor
Yr
Yv
Z
Zorg
[mid]
a
a
a
a
a
a
aa
aa
ae
ae
ai
ar'
au
ay
e
e
e
e
e
ea
ee
eo
ey
i
i
i
i
ia
ie
ie
iu
o
o
o
oa
oe
ou
u
u
u
ua
ue
uy
y
y
y
y
ya
ye
[final]
bad
bain
bar
bene
berry
beth
bin
bir
bis
bon
bra
bral
bran
bron
bryl
c
ch
ck
d
da
dah
dai
das
dd
de
del
den
dia
dlak
dle
do
don
dor
dos
fan
far
ffryn
g
ga
gan
gar
go
gor
gyn
gys
h
hnam
hran
k
k
ka
kain
kal
kan
ke
kin
l
l
l
la
ld
ld
lde
len
lir
ll
lom
lon
lren
lyr
m
ma
mael
man
marn
mber
me
mel
meld
min
mn
mosa
n
n
n
n-Aral
na
nal
nath
nath
nazar
nce
nd
nda
ndd
ndel
ndis
ndon
ndor
ndy
ne
ne
ned
nes
nid
nil
nis
nm
nn
nn
nna
nrae
ns
nsa
nsyl
nt
nt
nter
nton
ntor
nyl
nyn
nys
r
r
r
ra
rad
rader
rain
rak
rak-Diev
ral
rand
rant
rard
ras
rat
rath
rbel
rben
rd
rden
rdes
rdi
rdiar
rdis
rene
rgan
rgen
ri
rial
rian
rida
rik
rin
rine
ris
risa
rith
rjah
rk
rl
rlid
rlid
rm
rm
rn
rn
rna
rnan
rne
rnt
rny
ro
roas
ron
rond
rphet
rq
rri
rs
rsen
rsen
rshil
rt
rta
rth
rwar
ry
ryn
s
s
s
sa
san
sar
sar
sc
sdo
se
sel
sen
sh
shen
si
sid
sin
sir
sis
sta
stil
stra
sye
syr
t
ta
tan
tar
te
th
th
th
thar
thard
ther
thgir
thid
thtrasn
tta
va
ven
vin
von
w
wn
xa
y
z
zay
[end]

View file

@ -0,0 +1,107 @@
[inf]
H&acirc;rnic male names (simplified)
[first]
A
An
Ak
Al
Da
Der
Du
Di
E
Eve
En
Er
Es
Fa
Fe
Fi
Ga
Ge
Gem
Gi
Ha
He
Hi
I
Il
In
Is
Ka
Ke
Kh
Kha
Khe
La
Le
Li
Lo
Ma
Me
O
Ob
Ov
Op
Os
Ra
Re
Ri
Ry
Ta
Te
Th
Ti
U
Us
Uv
Za
Ze
[mid]
as
at
be
daz
d
de
dez
ea
eh
he
i
in
ki
li
ma
mak
mi
r
u
v
[final]
ain
ais
ard
as
dan
den
el
er
ef
f
fam
fus
ik
im
ol
on
ot
r
rt
ri
tan
te
tel
ulm
ur
[end]

View file

@ -0,0 +1,84 @@
[inf]
Sindarin female names
[first]
A
Al
Am
An
Ar
B
Ba
Be
Ca
Ce
Da
Do
E
El
Er
Fa
Fu
Ga
La
Le
Li
Ma
Mi
Mo
Na
Ni
Sa
Si
Th
Un
Va
[mid]
da
dar
dom
du
fi
fin
im
la
lai
lan
len
li
min
n
nar
or
ren
ria
ro
ran
st
tar
th
un
[final]
ind
ara
ana
del
dil
din
den
dan
in
hin
ian
iel
ila
ion
ira
nia
min
nil
nol
rel
ril
rina
tha
[end]

View file

@ -0,0 +1,79 @@
[inf]
Sindarin male names
[first]
A
Al
Am
An
Ar
B
Be
Ca
Ce
Do
E
El
Er
Fa
Fu
Gl
Le
Li
Mi
Mo
Na
Ni
Si
Th
Un
Va
[mid]
da
dar
dom
du
fi
fin
im
la
lai
lan
len
li
min
n
nar
or
ren
ria
ro
ran
st
tar
th
un
[final]
and
ar
del
dil
din
dir
dyne
en
er
hir
ian
iel
il
ion
ir
mar
mir
nil
nor
rel
ril
rin
th
[end]

View file

@ -0,0 +1,26 @@
[inf]
Tolkien hobbit names, namefile by Johan Danforth
Edited by Arkhan
[first]
B
Dr
Fr
Mer
Per
S
[mid]
a
e
i
ia
o
oi
u
[final]
bo
do
doc
go
grin
m
[end]

View file

@ -0,0 +1,179 @@
[inf]
Female names (fantasy), namefile by Johan Danforth
Edited by Arkhan
[first]
A
Ab
Ac
Ad
Af
Agr
Ast
As
Al
Adw
Adr
Ar
B
Br
C
C
C
Cr
Ch
Cad
D
Dr
Dw
Ed
Eth
Et
Er
El
Eow
F
Fr
G
Gr
Gw
Gw
Gal
Gl
H
Ha
Ib
Jer
K
Ka
Ked
L
Loth
Lar
Leg
M
Mir
N
Nyd
Ol
Oc
On
P
Pr
Q
R
Rh
S
Sev
T
Tr
Th
Th
Ul
Um
Un
V
Y
Yb
Z
W
W
Wic
[mid]
a
a
a
ae
ae
au
ao
are
ale
ali
ay
ardo
e
e
e
ei
ea
ea
eri
era
ela
eli
enda
erra
i
i
i
ia
ie
ire
ira
ila
ili
ira
igo
o
oa
oi
oe
ore
u
y
[final]
beth
cia
cien
clya
de
dia
dda
dien
dith
dia
lind
lith
lia
lian
lla
llan
lle
ma
mma
mwen
meth
n
n
n
nna
ndra
ng
ni
nia
niel
rith
rien
ria
ri
rwen
sa
sien
ssa
ssi
swen
thien
thiel
viel
via
ven
veth
wen
wen
wen
wen
wia
weth
wien
wiel
[end]

View file

@ -0,0 +1,214 @@
[inf]
Male names (fantasy), namefile by Johan Danforth
Edited by Arkhan
[first]
A
Ab
Ac
Ad
Af
Agr
Ast
As
Al
Adw
Adr
Ar
B
Br
C
C
C
Cr
Ch
Cad
D
Dr
Dw
Ed
Eth
Et
Er
El
Eow
F
Fr
G
Gr
Gw
Gw
Gal
Gl
H
Ha
Ib
J
Jer
K
Ka
Ked
L
Loth
Lar
Leg
M
Mir
N
Nyd
Ol
Oc
On
P
Pr
Q
R
Rh
S
Sev
T
Tr
Th
Th
Ul
Um
Un
V
Y
Yb
Z
W
W
Wic
[mid]
a
ae
ae
au
ao
are
ale
ali
ay
ardo
e
edri
ei
ea
ea
eri
era
ela
eli
enda
erra
i
ia
ie
ire
ira
ila
ili
ira
igo
o
oha
oma
oa
oi
oe
ore
u
y
[final]
a
and
b
bwyn
baen
bard
c
ch
can
d
dan
don
der
dric
dus
f
g
gord
gan
han
har
jar
jan
k
kin
kith
kath
koth
kor
kon
l
li
lin
lith
lath
loth
ld
ldan
m
mas
mos
mar
mond
n
nydd
nidd
nnon
nwan
nyth
nad
nn
nnor
nd
p
r
red
ric
rid
rin
ron
rd
s
sh
seth
sean
t
th
th
tha
tlan
trem
tram
v
vudd
w
wan
win
win
wyn
wyn
wyr
wyr
wyth
[end]
/* h„r „r filen slut */

129
plugins/util/names/inns.nam Normal file
View file

@ -0,0 +1,129 @@
A few of the (")best(") names I've gotten with this:
Drunken Dragon
Puking Pit
Genie's Wish
Bob's Busom
Frozen Orc
Octopus Lady (You seen Octopussy?)
Thirsty Lips
Sexy Swords
Pot Pit
Broken Drum (Can't be beat! ;> (Terry Prachett))
[inf]
Inn/Tavern/Bar/Pub Names
By Kimmo &quot;Arkhan&quot; Kulovesi
[first]
Bent
Black
Blind
Blue
Bob's
Joe's
Broken
Buxom
Cat's
Crow's
Dirty
Dragon
Dragon's
Drunken
Eagle's
Eastern
Falcon's
Fawning
Fiend's
Flaming
Frosty
Frozen
Gilded
Genie's
Golden
Golden
Gray
Green
King's
Licked
Lion's
Mended
Octopus
Old
Old
Orc's
Otik's
Tika's
Pink
Pot
Puking
Queen's
Red
Ruby
Delicate
Sea
Sexy
Shining
Silver
Singing
Strange
Thirsty
Violet
White
Wild
Yawing
[mid]
[final]
Axe
Barrel
Basilisk
Belly
Blade
Boar
Breath
Brew
Busom
Claw
Coin
Delight
Den
Dragon
Drum
Dwarf
Fist
Flea
Flower
Gem
Gryphon
Hand
Head
Inn
Lady
Maiden
Lantern
Lips
Monk
Mug
Nest
Orc
Pearl
Pig
Pit
Place
Tavern
Portal
Ranger
Rest
Sailor
Sleep
Song
Stool
Swan
Swords
Tree
Unicorn
Whale
Wish
Wizard
Rain
[end]

View file

@ -0,0 +1,89 @@
[inf]
Item names
By Kimmo &quot;Arkhan&quot; Kulovesi
[first]
Sword
Sword
Wand
Cloak
Robe
Stick
Staff
Ring
Amulet
Axe
Hammer
Shield
Halberd
Scythe
Scroll
Book
Book
Armor
Dagger
Bow
Lance
Mace
Flail
Javelin
Dart
Scourge
Spear
Sling
Rapier
Coin
Trident
Whip
Crown
Jewel
Ruby
Hoopak
Orb
Needle
Pin
[mid]
of
[final]
Valor
Magic
Power
Light
Kings
Knights
Shadows
Chaos
Flame
Faith
Fire
Death
Sorcery
Stoning
Hope
Healing
Pain
Hurting
Belar
Slaying
Haste
Avatar
Virtue
the Way
Angels
Devils
Speed
Flying
Seeing
Love
Hatred
Nagash
Sauron
Arthur
Ending
Torak
Aldur
Time
Evil
Morgoth
Lucifer
Arkhan
[end]

View file

@ -0,0 +1,70 @@
[inf]
Babylon 5 Narn names by Kevin G. Nunn
[first]
Ch'
Do'
G'
Gre'
Mak'
Na'
Re'
Sh'
So'
T'
Ta'
Th'
Thu'
Tu'
[mid]
Ba
Bo
Da
Do
Ga
Ge
Go
Ka
Ko
La
Le
Lo
Ma
Mo
Na
No
Oo
Pa
Po
Qua
Quo
Ra
Rala
Ro
Sha
Shali
Ska
Skali
Sta
Ste
Sto
Ta
Te
Tee
To
Tha
Tho
Va
Vo
Vy
Wa
[final]
ch
k
kk
l
n
r
th
s
[end]

View file

@ -0,0 +1,42 @@
[inf]
Tolkien orc names by Johan Danforth and Tobias Petersson
Edited by Arkhan
[first]
B
Er
G
Gr
H
P
Pr
R
V
Vr
[mid]
a
i
o
u
[final]
dash
dish
dush
gar
gor
gdush
lo
gdish
k
lg
nak
rag
rbag
rg
rk
ng
nk
rt
ol
urk
shnak
[end]

View file

@ -0,0 +1,71 @@
[inf]
Warhammer orc names, namefile by Johan Danforth and Tobias Petersson
Edited by Arkhan (use tolkien orc name for first name, and this for last)
[first]
Head
Face
Eye
Arm
Foot
Toe
Ear
Nose
Hair
Blood
Nail
Night
Snotling
Beast
Man
Finger
Goblin
Hobbit
Teeth
Elf
Rat
Ball
Ghoul
Knife
Axe
Wraith
Deamon
Dragon
Tooth
Death
Mother
Horse
Moon
Dwarf
Earth
Human
Grass
[mid]
[final]
killer
crucher
lover
thrower
throttler
eater
hammer
kicker
walker
puncher
dragger
stomper
torturer
ripper
mangler
hater
poker
chewer
cutter
slicer
juggler
raper
smasher
shooter
drinker
crawler
[end]

View file

@ -0,0 +1,126 @@
[inf]
[first]
Misty
Mist
Blossom
Claw
Breeze
Wind
Thunder
River
Stream
Rat
Long
Pebble
Stone
Rose
Tiger
Leopard
Sky
Wolf
Mouse
Hazel
Kestrel
Serval
Snow
Blue
Red
Birch
Willow
Grass
Maple
Dawn
Shimmer
Poppy
Fox
Opal
Badger
Grass
Shade
Shaded
Swift
Huge
Feather
Sand
Flower
Petal
Cherry
Lavender
Thorn
Thistle
Scar
Vole
Shrew
Bug
Beetle
Spider
Oak
Small
Big
Tiny
seed
Little
Tall
Vine
Lion
Jay
Holly
Berry
Dove
Leaf
Squirrel
Bent
Crooked
Bracken
Flame
Yellow
Grey
Lily
Seed
Bark
Blaze
[mid]
[final]
tail
shine
shade
breeze
foot
cloud
petal
thorn
heart
streak
stripe
dapple
spot
blaze
leg
claw
talon
feather
storm
leap
flight
petal
fall
wing
whisker
step
nose
poppy
shimmer
mist
blaze
light
stream
flow
berry
shadow
willow
frost
shard
scar
blade
flame

View file

@ -0,0 +1,69 @@
[inf]
Warrior Cats tribe names lolol
[first]
Tribe of
[mid]
Rushing
Blazing
Burning
Searing
Screeching
Turning
Falling
Rising
Swaying
Shining
Lapping
Running
Breaking
Roaring
Pouring
Awakening
Peaceful
Fallen
Hopeful
Gentle
Breezey
Deadly
Blooming
Glaring
Broken
Drifting
Peaceful
Raging
Cloudy
Flying
Rippling
Furious
Mystic
Shattered
Blossoming
[final]
Rocks
Clouds
Flames
Fire
Dreams
Hope
Wind
Water
Stars
Talons
Flight
Trees
Wings
Ripples
Thunder
Shade
Shadows
Claws
Talons
Fury
Mud
Mysteries
Shards
Ash
Ashes
Flowers
Petals
Blossoms

27
plugins/util/shorten.py Normal file
View file

@ -0,0 +1,27 @@
# # Lukeroge
from util import hook, http
try:
from re import match
from urllib2 import urlopen, Request, HTTPError
from urllib import urlencode
except ImportError, e:
raise Exception('Required module missing: %s' % e.args[0])
def tiny(url, user, apikey):
try:
params = urlencode({'longUrl': url, 'login': user, 'apiKey': apikey, 'format': 'json'})
j = http.get_json("http://api.bit.ly/v3/shorten?%s" % params)
if j['status_code'] == 200:
return j['data']['url']
raise Exception('%s'%j['status_txt'])
except HTTPError, e:
return "Invalid URL!"
@hook.command
def shorten(inp, bot = None):
".shorten <url> - Makes an j.mp/bit.ly shortlink to the url provided"
user = bot.config['api_keys']['bitly_user']
api = bot.config['api_keys']['bitly_api']
return tiny(inp, user, api)

19
plugins/word.py Normal file
View file

@ -0,0 +1,19 @@
import re
from util import hook, http
from BeautifulSoup import BeautifulSoup
@hook.command(autohelp=False)
def wordu(inp, say=False, nick=False):
".word -- gets the word of the day
return "true"
page = http.get('http://merriam-webster.com/word-of-the-day')
soup = BeautifulSoup(page)
word = soup.find('strong', {'class' : 'main_entry_word'})
function = soup.find('p', {'class' : 'word_function'})
#definitions = re.findall(r'<span class="ssens"><strong>:</strong>'
# r' *([^<]+)</span>', content)
say("(%s) The word of the day is: \x02%s\x02 (%s)" % (nick, word, function))

View file

@ -1,5 +1,5 @@
import re
from util import hook, http
from util import hook, http, misc
from BeautifulSoup import BeautifulSoup
@hook.command(autohelp=False)

0
run.sh Executable file
View file