tigre-client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/tigre-client/url.rb +15 -6
- data/lib/tigre-client/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/tigre-client/url.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module Tigre
|
2
2
|
class Url
|
3
3
|
|
4
|
-
# mimics a curl POST request using Curl
|
5
4
|
# required params
|
6
5
|
# url - String
|
7
6
|
# options - Hash
|
@@ -36,11 +35,10 @@ module Tigre
|
|
36
35
|
return [c.response_code, c.body_str]
|
37
36
|
end
|
38
37
|
|
39
|
-
# mimics a curl GET request using Curl
|
40
38
|
# required params
|
41
39
|
# sha256 - String
|
42
40
|
def self.get(sha256)
|
43
|
-
if sha256
|
41
|
+
if sha256 == ''
|
44
42
|
raise ArguementError, "Missing sha256 parameter"
|
45
43
|
end
|
46
44
|
|
@@ -50,6 +48,19 @@ module Tigre
|
|
50
48
|
return [c.response_code, c.body_str]
|
51
49
|
end
|
52
50
|
|
51
|
+
# required params
|
52
|
+
# sha256 - String
|
53
|
+
def self.get_md5(md5)
|
54
|
+
if md5 == ''
|
55
|
+
raise ArguementError, "Missing md5 parameter"
|
56
|
+
end
|
57
|
+
|
58
|
+
c = Curl::Easy.new("#{Tigre.endpoint}/urls/md5/#{md5}")
|
59
|
+
c.headers["API-TOKEN"] = Tigre.token
|
60
|
+
c.perform
|
61
|
+
return [c.response_code, c.body_str]
|
62
|
+
end
|
63
|
+
|
53
64
|
def self.index(options={})
|
54
65
|
options[:page] ||= 0
|
55
66
|
options[:per] ||= 50
|
@@ -60,7 +71,6 @@ module Tigre
|
|
60
71
|
return [c.response_code, c.body_str]
|
61
72
|
end
|
62
73
|
|
63
|
-
# mimics a curl GET request using Curl
|
64
74
|
# required params
|
65
75
|
# options - Hash
|
66
76
|
# :after => Ruby DateTime object OR Integer (epoch time)
|
@@ -86,7 +96,6 @@ module Tigre
|
|
86
96
|
return [c.response_code, c.body_str]
|
87
97
|
end
|
88
98
|
|
89
|
-
# mimics a curl GET request using Curl
|
90
99
|
# required params
|
91
100
|
# domain - String
|
92
101
|
# optional params
|
@@ -94,7 +103,7 @@ module Tigre
|
|
94
103
|
# :after => Ruby DateTime object OR Integer (epoch time)
|
95
104
|
# :before => Ruby DateTime object OR Integer (epoch time)
|
96
105
|
def self.domains(domain, options={})
|
97
|
-
if domain
|
106
|
+
if domain == ''
|
98
107
|
raise ArguementError, "Missing domain parameter"
|
99
108
|
end
|
100
109
|
|
data/lib/tigre-client/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tigre-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Marcio Castilho
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-04-06 00:00:00 -04:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|