module InstagramProfile

Grep instgram profiles

Public Instance Methods

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

  instagram_regex = %r{(?im)(https?:\/\/(?:www\.)?+instagram\.com\/(?!#|%|"|'|(?:explore|p)\/).+?[^"'<>\s?&\/]+)}
  response.scan(instagram_regex).flatten.compact.uniq
end