module Uirusu::VTUrl

Constants

REPORT_URL
SCAN_URL

Public Class Methods

feed(api_key, resource, **args) click to toggle source

Searches reports by URL from Virustotal.com

@param api_key Virustotal.com API key @param resource url to search

@return [JSON] Parsed response

# File lib/uirusu/vturl.rb, line 72
def self.feed(api_key, resource, **args)
        raise "#feed not yet implemented. This API call is only available to users that have licensed the unlimited tier of VirusTotal private Mass API."
end
query_report(api_key, resource, **args) click to toggle source

Searches reports by URL from Virustotal.com

@param api_key Virustotal.com API key @param resource url to search

@return [JSON] Parsed response

# File lib/uirusu/vturl.rb, line 53
def self.query_report api_key, resource, **args
        if resource == nil
                raise "Invalid resource, must be a valid url"
        end

        params = {
                apikey: api_key,
                resource: resource
        }

        Uirusu.query_api REPORT_URL, params.merge!(args), true
end
scan_url(api_key, resource) click to toggle source

Submits a URL to be scanned by Virustotal.com

@param api_key Virustotal.com API key @param resource url to submit

@return [JSON] Parsed response

# File lib/uirusu/vturl.rb, line 34
def self.scan_url api_key, resource
        if resource == nil
                raise "Invalid resource, must be a valid url"
        end

        params = {
                apikey: api_key,
                url: resource
        }

        Uirusu.query_api SCAN_URL, params, true
end