Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
little function to make a bib key based on data gleaned from rss feed data
# >> make_key('nytimes', '2011', 'Mapping the 2010 U.S. Census')
# => "nytimes:2011:mapping-2010-census"
def make_key(pubtoken, issued, title)
# first, split title into array, and throw out punctuation and short words
twords = title.scan(/\w+/).reject {|token| token.length < 4 }
# take first few resulting words, join and downcase
tslug = twords[0..3].join('-').downcase
return "#{pubtoken}:#{issued}:#{tslug}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.