Created
April 3, 2020 06:46
-
-
Save linuxandchill/83de12c66d123decef16de4c99e7248d to your computer and use it in GitHub Desktop.
maskedUp
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 characters
const fs = require('fs'); | |
const request = require('request'); | |
// accepts twtr username | |
// retrieves and runs rosebud face mask model | |
// saves img pic to disk | |
function maskItUp(userName) { | |
request.get({url: `https://avatars.io/twitter/${userName}`, encoding: null}, function (err, response, body) { | |
// pass img to rosebud masks4all | |
// let masked = await processing | |
// save result | |
fs.writeFile("masked.png", masked, 'binary', function(err) { | |
if(err) | |
console.log(err); | |
else | |
console.log("Masked up!"); | |
}); | |
}); | |
} | |
// run by passing twtr user as arg | |
maskItUp('tylerwhatsgood_') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment