module TwitterProfile

Grep twitter profile

Public Instance Methods

grep_twitter_profile(response) click to toggle source
# File lib/parsers/twitter_profile.rb, line 5
def grep_twitter_profile(response)
  return if response.nil? || response.empty?

  twitter_regex = %r{(?im)(https?:\/\/(?:www\.)?twitter\.com\/(?!\{\{)(?!(?:share|download|search|home|login|privacy)(?:\?|\/|\b)|(?:hashtag|i|javascripts|statuses|#!|intent)\/|(?:#|'|%))[^"'&\?<>\s\\]+)}
  response.scan(twitter_regex).flatten.compact.uniq
end