Created
February 7, 2010 08:24
-
-
Save johnholdun/297307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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(/(<|<).+?(>|>)/, '').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