Module: Janis
- Defined in:
- lib/janis.rb,
lib/janis/parsing.rb,
lib/janis/testing.rb,
lib/janis/version.rb,
lib/janis/validations.rb,
lib/janis/parser_factory.rb,
lib/janis/proxy_website_parser.rb,
lib/janis/specific_parsers/hide_my_ass.rb,
lib/janis/specific_parsers/proxy-list_org.rb
Overview
Defined Under Namespace
Modules: Parsing, Testing
Constant Summary
collapse
- IP_PORT_SEPARATOR =
':'
- VERSION =
"0.1.4"
Class Method Summary
collapse
Class Method Details
.find(amount, opts = {}) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/janis.rb', line 17
def self.find(amount, opts = {})
if opts[:websites]
opts[:websites].each do |website|
raise "#{website} is not supported!" unless Janis.supported_websites.include?(website)
end
websites = opts[:websites]
else
websites = Janis.supported_websites
end
total_results = []
websites.each do |website|
if total_results.size < amount
new_results = Parsing.parse_from(website).map { |entry| build_proxy_hash(entry, website) }
total_results += new_results
end
end
opts[:criteria] ? Janis::Testing.filter_results(criteria, total_results[0..amount - 1]) : total_results[0..amount -1]
end
|
.supported_websites ⇒ Object