#NEWLINE# @ internationalizeDocstring #NEWLINE# def rss( self , irc , msg , args , url , n ) : #NEWLINE# #INDENT# '<name|url> [<number of headlines>]\n\n        Gets the title components of the given RSS feed.\n        If <number of headlines> is given, return only that many headlines.\n        ' #NEWLINE# self . log . debug ( 'Fetching %u' , url ) #NEWLINE# feed = self . get_feed ( url ) #NEWLINE# if ( not feed ) : #NEWLINE# #INDENT# feed = Feed ( url , url , True ) #NEWLINE# #UNINDENT# if irc . isChannel ( msg . args [ 0 ] ) : #NEWLINE# #INDENT# channel = msg . args [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# channel = None #NEWLINE# #UNINDENT# self . update_feed_if_needed ( feed ) #NEWLINE# entries = feed . entries #NEWLINE# if ( not entries ) : #NEWLINE# #INDENT# irc . error ( _ ( "Couldn't get RSS feed." ) ) #NEWLINE# return #NEWLINE# #UNINDENT# n = ( n or self . registryValue ( 'defaultNumberOfHeadlines' , channel ) ) #NEWLINE# entries = list ( filter ( ( lambda e : self . should_send_entry ( channel , e ) ) , feed . entries ) ) #NEWLINE# entries = entries [ : n ] #NEWLINE# headlines = map ( ( lambda e : self . format_entry ( channel , feed , e , False ) ) , entries ) #NEWLINE# sep = self . registryValue ( 'headlineSeparator' , channel ) #NEWLINE# irc . replies ( headlines , joiner = sep )