Skip to content

Commit

Permalink
[url] Make .title-command actually output the title.
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-koivula committed Jun 28, 2013
1 parent 9e0afb2 commit ff4c1f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions url.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def title_command(bot, trigger):
urls = re.findall(url_finder, trigger)

results = process_urls(bot, trigger, urls)
for result in results[:4]:
message = '[ %s ] - %s' % tuple(result)
for title, domain in results[:4]:
bot.reply('[ %s ] - %s' % (title, domain))


@rule('(?u).*(https?://\S+).*')
Expand All @@ -113,8 +113,9 @@ def title_auto(bot, trigger):
results = process_urls(bot, trigger, urls)
bot.memory['last_seen_url'][trigger.sender] = urls[-1]

for result in results[:4]:
message = '[ %s ] - %s' % tuple(result)
for title, domain in results[:4]:
message = '[ %s ] - %s' % (title, domain)
# Guard against responding to other instances of this bot.
if message != trigger:
bot.say(message)

Expand Down

0 comments on commit ff4c1f9

Please sign in to comment.