summaryrefslogtreecommitdiff
path: root/src/Hastebin.js
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sio.be>2021-02-19 11:43:18 +0100
committerAlejandro Sior <aho@sio.be>2021-02-19 11:43:18 +0100
commit405051211d60afa8a7fc4fc3fa5ffb456242973d (patch)
treedbae34350c3a54f422da70f1b7fbd857a8f5a116 /src/Hastebin.js
initial commit
Diffstat (limited to 'src/Hastebin.js')
-rw-r--r--src/Hastebin.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Hastebin.js b/src/Hastebin.js
new file mode 100644
index 0000000..1d7bae0
--- /dev/null
+++ b/src/Hastebin.js
@@ -0,0 +1,6 @@
+const superagent = require('superagent');
+
+module.exports = async function hastebin(text) {
+ let res = await superagent.post('https://hasteb.in/documents').send(text);
+ return JSON.parse(res.text).key;
+}; \ No newline at end of file