+ # Make an 'unique' ID for a given item, based on appropriate bot options
+ # Currently only suppored is bot.config['rss.show_updated']: when false,
+ # only the guid/link is accounted for.
+
+ def block_rescue(df = nil, &block)
+ v = block.call rescue nil
+ (String === v && '' != v) ? v : nil
+ end
+
+ def make_uid(item)
+ uid = [
+ (block_rescue do item.guid.content end ||
+ block_rescue do item.guid end ||
+ block_rescue do item.link.href end ||
+ block_rescue do item.link end
+ )
+ ]
+ if @bot.config['rss.show_updated']
+ uid.push(
+ block_rescue do item.content.content end ||
+ block_rescue do item.description end
+ )
+ uid.unshift(
+ block_rescue do item.title.content end ||
+ block_rescue do item.title end
+ )
+ end
+ # debug "taking hash of #{uid.inspect}"
+ uid.hash
+ end
+
+