Skip to content

Instantly share code, notes, and snippets.

@johnholdun
Created February 7, 2010 08:24
Show Gist options
  • Save johnholdun/297307 to your computer and use it in GitHub Desktop.
Save johnholdun/297307 to your computer and use it in GitHub Desktop.
# title_is_summary - does this RSS item REALLY have a title?
# see: tumblr photo posts
#
# title = (title of some RSS item)
# description = (description of the same item)
clean_title = title.strip.gsub(/\s+/, ' ').sub(/\.\.\.$/, '')
clean_description = description.gsub(/(<|&lt;).+?(>|&gt;)/, '').strip.gsub(/\s+/, ' ')
title_is_summary = clean_title == clean_description[0 .. clean_title.size - 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment