Uploaded the old launcher to the disabled_stuff folder, because some people still want it
This commit is contained in:
parent
fa630eb285
commit
1be43d9e51
9 changed files with 126 additions and 0 deletions
20
disabled_stuff/wordoftheday.py
Executable file
20
disabled_stuff/wordoftheday.py
Executable file
|
@ -0,0 +1,20 @@
|
|||
import re
|
||||
from util import hook, http, misc
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
|
||||
|
||||
@hook.command(autohelp=False)
|
||||
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'}).renderContents()
|
||||
function = soup.find('p', {'class': 'word_function'}).renderContents()
|
||||
|
||||
#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))
|
Reference in a new issue