阿里云绿网内容检测API 封装
npm install aliyun-cdi
var request = require('request');
var composeUrl = require('aliyun-cdi');
var url = composeUrl({
AccessKeyID: 'XXX', // 你申请的AccessKeyID
AccessKeySecret: 'XXX', // 你申请的AccessKeySecret
Action: 'ImageDetection', // Action
Scene: ['porn'], // 场景
ImageUrl: ['http://dun.163.com/res/sample/sex_2.jpg'] // 资源实例
});
request.post(url, function (err, res, body) {
if (res.statusCode === 200) {
console.log(body);
} else {
console.log(res.statusCode, err);
}
});