Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

fixed regexp in horo.py #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/horo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def handler_horoscope(type, jid, nick, text):
if param in [L(t) for t in horodb] or param in horodb:
if param not in horodb: param = dict([[L(t),t] for t in horodb])[param]
body = html_encode(load_page('http://horo.mail.ru/prediction/%s/today' % param))
try: msg = unhtml_hard(re.findall('<div id="tm_today">(.+?)<div class="mb2">',body,re.S|re.I|re.U)[0].strip())
try: msg = unhtml_hard(re.findall('<div class="article__item article__item_alignment_left article__item_html">(.+?)<div class="p-score-day margin_top_20 margin_bottom_10">',body,re.S|re.I|\
re.U)[0].strip())
except: msg = L('Unknown error!','%s/%s'%(jid,nick))
if type=='groupchat':
send_msg('chat', jid, nick, msg)
Expand Down