@rule(u'(?u).*(https?://\\S+).*')
def title_auto(bot, trigger):
 if re.match((bot.config.core.prefix + u'title'), trigger):
  return
 if ((u'safety_cache' in bot.memory) and (trigger in bot.memory[u'safety_cache'])):
  if (bot.memory[u'safety_cache'][trigger][u'positives'] > 1):
   return
 urls = re.findall(url_finder, trigger)
 if (len(urls) == 0):
  return
 results = process_urls(bot, trigger, urls)
 bot.memory[u'last_seen_url'][trigger.sender] = urls[(-1)]
 for (title, domain) in results[:4]:
  message = (u'[ %s ] - %s' % (title, domain))
  if (message != trigger):
   bot.say(message)

@ rule ( u'(?u).*(https?://\\S+).*' ) def title_auto ( bot , trigger ) : if re . match ( ( bot . config . core . prefix + u'title' ) , trigger ) : return if ( ( u'safety_cache' in bot . memory ) and ( trigger in bot . memory [ u'safety_cache' ] ) ) : if ( bot . memory [ u'safety_cache' ] [ trigger ] [ u'positives' ] > 1 ) : return urls = re . findall ( url_finder , trigger ) if ( len ( urls ) == 0 ) : return results = process_urls ( bot , trigger , urls ) bot . memory [ u'last_seen_url' ] [ trigger . sender ] = urls [ ( - 1 ) ] for ( title , domain ) in results [ : 4 ] : message = ( u'[ %s ] - %s' % ( title , domain ) ) if ( message != trigger ) : bot . say ( message )
automatically show titles for urls .