Skip to content

Instantly share code, notes, and snippets.

@eric-famiglietti
eric-famiglietti / module.rb
Created December 6, 2012 19:01
OO Design Exercise Solution
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