-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
41 lines (35 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var unirest = require('unirest');
JsonWhois = {
apiKey: function (key){
this.apiKey = key;
this.base = "http://jsonwhois.com/api/v1";
return module.exports;
},
whois : function(domain, done){
unirest.get(this.base + 'whois')
.headers({
'Accept': 'application/json',
'Authorization': 'Token token=" ' + this.apiKey + ' "'
})
.query({
"domain": domain
})
.end(function (response) {
return done(response.body);
});
},
screenshot: function(domain, done){
unirest.get(this.base + 'screenshot')
.headers({
'Accept': 'application/json',
'Authorization': 'Token token=" ' + this.apiKey + ' "'
})
.query({
"domain": domain
})
.end(function (response) {
return done(response.body);
});
}
}
module.exports = JsonWhois;