Skip to content

Instantly share code, notes, and snippets.

@linuxandchill
Created April 3, 2020 06:46
Show Gist options
  • Save linuxandchill/83de12c66d123decef16de4c99e7248d to your computer and use it in GitHub Desktop.
Save linuxandchill/83de12c66d123decef16de4c99e7248d to your computer and use it in GitHub Desktop.
maskedUp
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