X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Frss.rb;h=22aa742ff6bc3c08f98a1020123f9c8e19ace2f2;hb=b0c7f5f17b65043a796f8b3f4dc27cbfa287e087;hp=5e7eff215ace9115f665d2a5a5d0e89b6f71ad6c;hpb=922c6a35bb34598da397d2a0078adc397e84a853;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 5e7eff21..22aa742f 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -815,9 +815,18 @@ class RSSFeedsPlugin < Plugin end end - title = "#{Bold}#{item.title.ircify_html :limit => @bot.config['rss.head_max']}#{Bold}" if item.title + tit_opt = {} + # Twitters don't need a cap on the title length since they have a hard + # limit to 160 characters, and most of them are under 140 characters + tit_opt[:limit] = @bot.config['rss.head_max'] unless feed.type == 'twitter' - desc = item.description.ircify_html(:limit => @bot.config['rss.text_max'], :a_href => :link_out) if item.description + title = "#{Bold}#{item.title.ircify_html(tit_opt)}#{Bold}" if item.title + + desc_opt = { + :limit => @bot.config['rss.text_max'], + :a_href => :link_out + } + desc = item.description.ircify_html(desc_opt) if item.description link = item.link.chomp if item.link