fix: exception in rss
This commit is contained in:
@@ -90,6 +90,12 @@ def clients_stats(type, jid, nick, text):
|
|||||||
elif text: match = '%%%s%%' % reduce_spaces_all(' '.join(text))
|
elif text: match = '%%%s%%' % reduce_spaces_all(' '.join(text))
|
||||||
else: is_short = is_global = is_os = is_user = False
|
else: is_short = is_global = is_os = is_user = False
|
||||||
|
|
||||||
|
# global os short
|
||||||
|
# select split_part(replace(replace(replace(replace(replace(replace(replace(lower(os),'/',' '),'"',''),'microsoft',''),'(c)',''),'©',''),'name=',''),'none',''),' ',1) as oss, count(*) as coss from versions group by oss order by coss desc;
|
||||||
|
|
||||||
|
# global short
|
||||||
|
# select split_part(client,' ',1) as clients, count(*) as cclients from versions group by clients order by cclients desc;
|
||||||
|
|
||||||
if is_global:
|
if is_global:
|
||||||
if is_user: req,par = 'select client,version,os from versions where jid=%s and (client ilike %s or version ilike %s or os ilike %s)',(cjid,match,match,match)
|
if is_user: req,par = 'select client,version,os from versions where jid=%s and (client ilike %s or version ilike %s or os ilike %s)',(cjid,match,match,match)
|
||||||
else: req,par = 'select client,version,os from versions where client ilike %s or version ilike %s or os ilike %s',(match,match,match)
|
else: req,par = 'select client,version,os from versions where client ilike %s or version ilike %s or os ilike %s',(match,match,match)
|
||||||
|
|||||||
@@ -1308,6 +1308,7 @@ def rss(type, jid, nick, text):
|
|||||||
elif mode in ['new','get']:
|
elif mode in ['new','get']:
|
||||||
link = text[1]
|
link = text[1]
|
||||||
if not re.findall('^http(s?)://',link[:10]): link = 'http://%s' % link
|
if not re.findall('^http(s?)://',link[:10]): link = 'http://%s' % link
|
||||||
|
if cur_execute_fetchone('select * from feed where room=%s and url=%s;',(jid,link)):
|
||||||
body, result = get_opener(enidna(link))
|
body, result = get_opener(enidna(link))
|
||||||
modified,need_update_feed = '',True
|
modified,need_update_feed = '',True
|
||||||
if result:
|
if result:
|
||||||
@@ -1429,6 +1430,7 @@ def rss(type, jid, nick, text):
|
|||||||
else: title = html_encode(get_tag(feed,'title'))
|
else: title = html_encode(get_tag(feed,'title'))
|
||||||
msg = L('Bad url or rss/atom not found at %s - %s','%s/%s'%(jid,nick)) % (link,title)
|
msg = L('Bad url or rss/atom not found at %s - %s','%s/%s'%(jid,nick)) % (link,title)
|
||||||
else: msg = feed
|
else: msg = feed
|
||||||
|
else: msg = L('Not found!','%s/%s'%(jid,nick))
|
||||||
if not nosend: send_msg(type, jid, nick, msg)
|
if not nosend: send_msg(type, jid, nick, msg)
|
||||||
|
|
||||||
def configure(type, jid, nick, text):
|
def configure(type, jid, nick, text):
|
||||||
|
|||||||
Reference in New Issue
Block a user