Skip to content

Instantly share code, notes, and snippets.

@atinypixel
Forked from arjunghosh/tweet_parser.rb
Created October 26, 2009 17:59
Show Gist options
  • Save atinypixel/218865 to your computer and use it in GitHub Desktop.
Save atinypixel/218865 to your computer and use it in GitHub Desktop.
# To parse a tweet from twitter to get teh '@' , '#' and the text seperated
parsed_text = tweet.text.gsub(/ ?(@\w+)| ?(#\w+)/) { |a| ((a.include?('#')) ? tags : replies) << a.strip.gsub(/#|@/,''); '' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment