Skip to content

Instantly share code, notes, and snippets.

@arjunghosh
Created March 13, 2009 09:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save arjunghosh/78498 to your computer and use it in GitHub Desktop.
Save arjunghosh/78498 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