Created
August 10, 2020 00:33
Revisions
-
geek-at created this gist
Aug 10, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ const request = require('request') const fs = require('fs'); var req = request.post("https://nsfw-categorize.it/api/upload", function (err, resp, body) { if (err) { console.log('Error!'); } else { var json = JSON.parse(body) if(json.status=='OK') console.log("This image has been classified as",json.data.classification) else console.log("Error",json.reason) } }); var form = req.form(); form.append('image', fs.createReadStream('1.jpg'));