This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SocialExtractor | |
require 'nokogiri' | |
require 'open-uri' | |
def self.get_social_profile url | |
# If it's not a Twitter URL, throw exception | |
if url.nil? || !url.include?('twitter.com') | |
raise Exception, "Invalid URL." | |
end |