Module: Uirusu::VTComment
- Defined in:
- lib/uirusu/vtcomment.rb
Overview
Module for submiting comments to Virustotal.com resources using the Virustotal.com public API
Constant Summary collapse
Class Method Summary collapse
-
.get_comments(api_key, resource, before = nil) ⇒ JSON
Retrieve a list of comments to Virustotal.com for a specific resource.
-
.post_comment(api_key, resource, comment) ⇒ JSON
Submits a comment to Virustotal.com for a specific resource.
Class Method Details
.get_comments(api_key, resource, before = nil) ⇒ JSON
Retrieve a list of comments to Virustotal.com for a specific resource
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/uirusu/vtcomment.rb', line 59 def self.get_comments(api_key, resource, before=nil) if resource == nil raise "Invalid resource, must be a valid url" end params = { apikey: api_key, resource: resource } params[:before] = before unless before.nil? Uirusu.query_api GET_URL, params end |
.post_comment(api_key, resource, comment) ⇒ JSON
Submits a comment to Virustotal.com for a specific resource
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/uirusu/vtcomment.rb', line 35 def self.post_comment(api_key, resource, comment) if resource == nil raise "Invalid resource, must be a valid url" end if comment == nil raise "You must provide a comment to submit." end params = { apikey: api_key, resource: resource, comment: comment } Uirusu.query_api POST_URL, params end |