Skip to content

Instantly share code, notes, and snippets.

@kevinclark
Created October 30, 2009 22:04
Show Gist options
  • Save kevinclark/222768 to your computer and use it in GitHub Desktop.
Save kevinclark/222768 to your computer and use it in GitHub Desktop.
class AbstractScraper
def initialize
@agent = WWW::Mechanize.new
@agent.user_agent_alias = "Windows Mozilla"
@agent.keep_alive = false
end
end
class AuthenticatedScraper < AbstractScraper
def initialize(username, password)
super()
login(username, password)
end
end
class NormalAScraper < AbstractScraper; end
class NormalBScraper < AbstractScraper; end
class GoofyScraper < AuthenticatedScraper
def initialize
super()
login # apparently login takes *args?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment