diff --git a/plugins/word.py b/plugins/word.py index 6b2ac12..7ab671b 100644 --- a/plugins/word.py +++ b/plugins/word.py @@ -1,19 +1,18 @@ import re -from util import hook, http +from util import hook, http, misc from BeautifulSoup import BeautifulSoup @hook.command(autohelp=False) -def wordu(inp, say=False, nick=False): - ".word -- gets the word of the day - return "true" +def word(inp, say=False, nick=False): + ".word -- gets the word of the day" 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'}) + word = soup.find('strong', {'class' : 'main_entry_word'}).renderContents() + function = soup.find('p', {'class' : 'word_function'}).renderContents() #definitions = re.findall(r':' # r' *([^<]+)', content) - say("(%s) The word of the day is: \x02%s\x02 (%s)" % (nick, word, function)) \ No newline at end of file + say("(%s) The word of the day is: \x02%s\x02 (%s)" % (nick, word, function))