Sha256: da0ec22f785e49db949724c7fbd49ae8f36531b1b297d3caf4a6802d2375dc10
Contents?: true
Size: 612 Bytes
Versions: 13
Compression:
Stored size: 612 Bytes
Contents
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require "shodanz" require "chart_js" module Top10 @rest_api = Shodanz.api.rest.new def self.check(product) begin @rest_api.host_count(product: product, facets: { country: 10 })["facets"]["country"].collect { |x| x.values }.to_h.invert rescue puts "Unable to succesffully check the Shodan API." exit 1 end end end results = Top10.check("apache") ChartJS.bar do file "top_10_apache.html" data do labels results.keys dataset "Countries" do color :random data results.values end end end
Version data entries
13 entries across 13 versions & 1 rubygems