Skip to content

Instantly share code, notes, and snippets.

@shanlalit
Forked from arjunghosh/tweet_parser.rb
Created May 20, 2010 15:48
Show Gist options
  • Save shanlalit/407718 to your computer and use it in GitHub Desktop.
Save shanlalit/407718 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