Module: Uirusu::VTUrl

Defined in:
lib/uirusu/vturl.rb

Constant Summary collapse

SCAN_URL =
Uirusu::VT_API + "/url/scan"
REPORT_URL =
Uirusu::VT_API + "/url/report"

Class Method Summary collapse

Class Method Details

.feed(api_key, resource, **args) ⇒ JSON

Searches reports by URL from Virustotal.com

Parameters:

  • api_key

    Virustotal.com API key

  • resource

    url to search

Returns:

  • (JSON)

    Parsed response



72
73
74
# 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) ⇒ JSON

Searches reports by URL from Virustotal.com

Parameters:

  • api_key

    Virustotal.com API key

  • resource

    url to search

Returns:

  • (JSON)

    Parsed response



53
54
55
56
57
58
59
60
61
62
63
64
# 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) ⇒ JSON

Submits a URL to be scanned by Virustotal.com

Parameters:

  • api_key

    Virustotal.com API key

  • resource

    url to submit

Returns:

  • (JSON)

    Parsed response



34
35
36
37
38
39
40
41
42
43
44
45
# 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