Skip to content

Instantly share code, notes, and snippets.

@terrbear
Created April 9, 2009 17:39
Show Gist options
  • Select an option

  • Save terrbear/92617 to your computer and use it in GitHub Desktop.

Select an option

Save terrbear/92617 to your computer and use it in GitHub Desktop.
module TweetsHelper
def filter_body(body)
newbody = body.clone
newbody = newbody.gsub(Twitter::NAME_REGEX) do |match|
"#{$1}\"#{match[/@\w+/].strip}\":http://www.twitter.com/#{match[/\w+/].strip}"
end
newbody = newbody.gsub(Hashtag::REGEX) do |match|
$0 #spits out "script/server"
#"\"#{$1}\":http://www.hashtags.org/tag/#{match[/\w+/].strip}"
end
textilize newbody
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment