tigre-client 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/tigre-client/sample.rb +4 -4
- data/lib/tigre-client/url.rb +5 -5
- data/lib/tigre-client/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/tigre-client/sample.rb
CHANGED
@@ -14,7 +14,7 @@ module Tigre
|
|
14
14
|
|
15
15
|
c = Curl::Easy.new("#{Tigre.endpoint}/samples")
|
16
16
|
c.multipart_form_post = true
|
17
|
-
c.headers["
|
17
|
+
c.headers["API-TOKEN"] = Tigre.token
|
18
18
|
|
19
19
|
post_data = options.map {|k, v| Curl::PostField.content(k, v.to_s)}
|
20
20
|
post_data << Curl::PostField.file("file", file_location)
|
@@ -28,7 +28,7 @@ module Tigre
|
|
28
28
|
# md5 - String
|
29
29
|
def self.md5(md5)
|
30
30
|
c = Curl::Easy.new("#{Tigre.endpoint}/samples/md5/#{md5}")
|
31
|
-
c.headers["
|
31
|
+
c.headers["API-TOKEN"] = Tigre.token
|
32
32
|
c.perform
|
33
33
|
return [c.response_code, c.body_str]
|
34
34
|
end
|
@@ -37,7 +37,7 @@ module Tigre
|
|
37
37
|
# sha1 - String
|
38
38
|
def self.sha1(sha1)
|
39
39
|
c = Curl::Easy.new("#{Tigre.endpoint}/samples/sha1/#{sha1}")
|
40
|
-
c.headers["
|
40
|
+
c.headers["API-TOKEN"] = Tigre.token
|
41
41
|
c.perform
|
42
42
|
return [c.response_code, c.body_str]
|
43
43
|
end
|
@@ -46,7 +46,7 @@ module Tigre
|
|
46
46
|
# sha256 - String
|
47
47
|
def self.sha256(sha256)
|
48
48
|
c = Curl::Easy.new("#{Tigre.endpoint}/samples/sha256/#{sha256}")
|
49
|
-
c.headers["
|
49
|
+
c.headers["API-TOKEN"] = Tigre.token
|
50
50
|
c.perform
|
51
51
|
return [c.response_code, c.body_str]
|
52
52
|
end
|
data/lib/tigre-client/url.rb
CHANGED
@@ -32,7 +32,7 @@ module Tigre
|
|
32
32
|
|
33
33
|
c = Curl::Easy.new("#{Tigre.endpoint}/urls")
|
34
34
|
c.multipart_form_post = false
|
35
|
-
c.headers["
|
35
|
+
c.headers["API-TOKEN"] = Tigre.token
|
36
36
|
|
37
37
|
c.http_post(post_data)
|
38
38
|
|
@@ -48,7 +48,7 @@ module Tigre
|
|
48
48
|
end
|
49
49
|
|
50
50
|
c = Curl::Easy.new("#{Tigre.endpoint}/urls/#{sha256}")
|
51
|
-
c.headers["
|
51
|
+
c.headers["API-TOKEN"] = Tigre.token
|
52
52
|
c.perform
|
53
53
|
return [c.response_code, c.body_str]
|
54
54
|
end
|
@@ -58,7 +58,7 @@ module Tigre
|
|
58
58
|
options[:per] ||= 50
|
59
59
|
|
60
60
|
c = Curl::Easy.new("#{Tigre.endpoint}/urls?page=#{options[:page]}&per=#{options[:per]}")
|
61
|
-
c.headers["
|
61
|
+
c.headers["API-TOKEN"] = Tigre.token
|
62
62
|
c.perform
|
63
63
|
return [c.response_code, c.body_str]
|
64
64
|
end
|
@@ -84,7 +84,7 @@ module Tigre
|
|
84
84
|
options[:per] ||= 50
|
85
85
|
|
86
86
|
c = Curl::Easy.new("#{Tigre.endpoint}/urls/daterange?after=#{options[:after]}&before=#{options[:before]}&page=#{options[:page]}&per=#{options[:per]}")
|
87
|
-
c.headers["
|
87
|
+
c.headers["API-TOKEN"] = Tigre.token
|
88
88
|
c.perform
|
89
89
|
return [c.response_code, c.body_str]
|
90
90
|
end
|
@@ -112,7 +112,7 @@ module Tigre
|
|
112
112
|
options[:per] ||= 50
|
113
113
|
|
114
114
|
c = Curl::Easy.new("#{Tigre.endpoint}/urls/domains?domain=#{domain}&after=#{options[:after]}&before=#{options[:before]}&page=#{options[:page]}&per=#{options[:per]}")
|
115
|
-
c.headers["
|
115
|
+
c.headers["API-TOKEN"] = Tigre.token
|
116
116
|
c.perform
|
117
117
|
return [c.response_code, c.body_str]
|
118
118
|
end
|
data/lib/tigre-client/version.rb
CHANGED