-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample.js
47 lines (34 loc) · 1.4 KB
/
example.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
42
43
44
45
var sightengine = require('./sightengine')('api_user','api_secret');
// feedback
sightengine.feedback('nudity', 'safe', 'https://sightengine.com/assets/img/examples/example5.jpg').then((result) => {
console.log(result)
}).catch((error) => {
console.log(error);
});
// moderation image
sightengine.check(['nudity', 'type', 'properties','wad','faces']).set_url('https://sightengine.com/assets/img/examples/example5.jpg').then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});
sightengine.check(['nudity', 'type', 'properties','wad','faces']).set_file('/assets/image.jpg').then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});
sightengine.check(['nudity', 'type', 'properties','wad','faces']).set_bytes(imageBinary).then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});
// moderation video
sightengine.check(['nudity', 'type', 'properties','wad','faces']).video('https://sightengine.com/assets/stream/examples/funfair.mp4', 'http://requestb.in/1d097l71').then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});
sightengine.check(['nudity', 'type', 'properties','wad','faces']).video_sync('https://sightengine.com/assets/stream/examples/funfair.mp4').then(function(result) {
console.log(result)
}).catch(function(error) {
console.log(error)
});