Sha256: 54fb4b2ff3690444999019ee6b794d39a3f785a58be0837a63f48b8843696301

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

=begin

class MyAwesomeProxyListParser < Janis::Parsing::WebSpecificParsers::ProxyWebsiteParser

  include CapybaraWithPanthomJs # optional - only if you use capybara-poltergeist for parsing

  def self.url
    # url to the proxy list website you will be parsing in the #parse method
  end

  def configure_capybara # optional - only if you use capybara-poltergeist for parsing
    Capybara.configure { |c| c.app_host = url }
  end

  def initialize
    super
    configure_capybara # optional - only if you use capybara-poltergeist for parsing
    @session = new_session # optional - only if you use capybara-poltergeist for parsing
    @session.visit(url) # optional - only if you use capybara-poltergeist for parsing
    obtain_html_doc
  end

  def parse
      # Your code to parse the page's content and deliver an array of strings
      # Those strings must have the format "IP:PORT_NUMBER"
  end

  private

  def obtain_html_doc # optional - Redefine the way the html document to parse is obtained if you use capybara/poltergeist
    @html_doc = Nokogiri.HTML(@session.html)
  end

end

=end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
janis-0.1.4 lib/janis/specific_parsers/template.rb
janis-0.1.3 lib/janis/specific_parsers/template.rb
janis-0.1.2 lib/janis/specific_parsers/template.rb
janis-0.1.1 lib/janis/specific_parsers/template.rb
janis-0.1.0 lib/janis/specific_parsers/template.rb