Initial Commit

This commit is contained in:
Julia 2021-10-17 22:59:44 +02:00
commit 0464fcd084
9 changed files with 137 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
config.js

5
Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM node:lts
COPY --chown=node ./src /home/node/WebhookShitposter
WORKDIR /home/node/WebhookShitposter
USER node
CMD [ "node", "index.js" ]

11
LICENSE Normal file
View file

@ -0,0 +1,11 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

14
README.md Normal file
View file

@ -0,0 +1,14 @@
# (Multithreaded-)WebhookShitposter
## How to use??
1. Copy `config.example.js` to `config.js`
2. Put some copypasta into `texts.d` as a raw text file (an example is included)
3. Edit `config.js` according to your needs
4. Run `docker-compose up --build`
## Notes
* This project probably won't recieve updates.
* I wasn't too bothered to include proper error handling.
* Also no comments because I was too lazy.

10
config.example.js Normal file
View file

@ -0,0 +1,10 @@
module.exports = [
{
webhooks: [
`https://discordapp.com/api/webhooks/id/token`,
`https://discordapp.com/api/webhooks/id2/token2`
],
text: `susbible`,
intervals: { minimum: 1250, maximum: 2500 }
}
]

8
docker-compose.yml Normal file
View file

@ -0,0 +1,8 @@
version: "3"
services:
webhookshitposter:
build: .
volumes:
- ./config.js:/home/node/WebhookShitposter/config.js
- ./texts.d:/home/node/WebhookShitposter/texts.d

14
src/index.js Normal file
View file

@ -0,0 +1,14 @@
const config = require(`./config`);
const workerThreads = require(`worker_threads`);
const path = require(`path`);
let threads = [];
config.forEach(entry => {
threads.push(new workerThreads.Worker(
path.join(__dirname, `worker.js`),
{
workerData: entry
}
));
});

37
src/worker.js Normal file
View file

@ -0,0 +1,37 @@
const workerThreads = require(`worker_threads`);
const workerData = workerThreads.workerData;
const fs = require(`fs`);
const path = require(`path`);
const https = require(`https`);
function random(minimum, maximum) {
return Math.floor((Math.random() * (maximum - minimum)) + minimum);
}
let timer = 0;
let currentLine = 0;
let currentWebhook = 0;
let currentInterval = 0;
let lines = fs.readFileSync(path.join(__dirname, `texts.d`, workerData.text)).toString().split(/\r?\n+/g);
setInterval(() => {
if (timer >= currentInterval) {
if (currentLine >= lines.length) currentLine = 0;
if (currentWebhook >= workerData.webhooks.length) currentWebhook = 0;
https.request(workerData.webhooks[currentWebhook], {
method: `POST`,
headers: {
"Content-Type": `application/json`
}
}).end(JSON.stringify({
content: lines[currentLine]
}))
currentLine ++;
currentWebhook ++;
currentInterval = random(workerData.intervals.minimum, workerData.intervals.maximum);
timer = 0;
}
timer ++;
}, 1);

37
texts.d/susbible Normal file
View file

@ -0,0 +1,37 @@
All "among us" in the Bible.
Genesis 23:6 Hear us, my lord: thou art a mighty prince among us: in the choice of our sepulchres bury thy dead; none of us shall withhold from thee his sepulchre, but that thou mayest bury thy dead.
Genesis 34:22 Only herein will the men consent unto us for to dwell with us, to be one people, if every male among us be circumcised, as they are circumcised.
Exodus 17:7 And he called the name of the place Massah, and Meribah, because of the chiding of the children of Israel, and because they tempted the Lord, saying, Is the Lord among us, or not?
Exodus 34:9 And he said, If now I have found grace in thy sight, O Lord, let my Lord, I pray thee, go among us; for it is a stiffnecked people; and pardon our iniquity and our sin, and take us for thine inheritance.
Numbers 27:4 Why should the name of our father be done away from among his family, because he hath no son? Give unto us therefore a possession among the brethren of our father.
Deuteronomy 31:17 Then my anger shall be kindled against them in that day, and I will forsake them, and I will hide my face from them, and they shall be devoured, and many evils and troubles shall befall them; so that they will say in that day, Are not these evils come upon us, because our God is not among us?
Joshua 9:7 And the men of Israel said unto the Hivites, Peradventure ye dwell among us; and how shall we make a league with you?
Joshua 9:22 And Joshua called for them, and he spake unto them, saying, Wherefore have ye beguiled us, saying, We are very far from you; when ye dwell among us?
Joshua 22:19 Notwithstanding, if the land of your possession be unclean, then pass ye over unto the land of the possession of the Lord, wherein the Lord's tabernacle dwelleth, and take possession among us: but rebel not against the Lord, nor rebel against us, in building you an altar beside the altar of the Lord our God.
Joshua 22:31 And Phinehas the son of Eleazar the priest said unto the children of Reuben, and to the children of Gad, and to the children of Manasseh, This day we perceive that the Lord is among us, because ye have not committed this trespass against the Lord: now ye have delivered the children of Israel out of the hand of the Lord.
Judges 18:25 And the children of Dan said unto him, Let not thy voice be heard among us, lest angry fellows run upon thee, and thou lose thy life, with the lives of thy household.
1 Samuel 4:3 And when the people were come into the camp, the elders of Israel said, Wherefore hath the Lord smitten us to day before the Philistines? Let us fetch the ark of the covenant of the Lord out of Shiloh unto us, that, when it cometh among us, it may save us out of the hand of our enemies.
1 Kings 5:6 Now therefore command thou that they hew me cedar trees out of Lebanon; and my servants shall be with thy servants: and unto thee will I give hire for thy servants according to all that thou shalt appoint: for thou knowest that there is not among us any that can skill to hew timber like unto the Sidonians.
Job 34:37 For he addeth rebellion unto his sin, he clappeth his hands among us, and multiplieth his words against God.
Psalm 74:9 We see not our signs: there is no more any prophet: neither is there among us any that knoweth how long.Genesis 23:6 Hear us, my lord: thou art a mighty prince among us: in the choice of our sepulchres bury thy dead; none of us shall withhold from thee his sepulchre, but that thou mayest bury thy dead.
Genesis 34:22 Only herein will the men consent unto us for to dwell with us, to be one people, if every male among us be circumcised, as they are circumcised.
Exodus 17:7 And he called the name of the place Massah, and Meribah, because of the chiding of the children of Israel, and because they tempted the Lord, saying, Is the Lord among us, or not?
Exodus 34:9 And he said, If now I have found grace in thy sight, O Lord, let my Lord, I pray thee, go among us; for it is a stiffnecked people; and pardon our iniquity and our sin, and take us for thine inheritance.
Deuteronomy 31:17 Then my anger shall be kindled against them in that day, and I will forsake them, and I will hide my face from them, and they shall be devoured, and many evils and troubles shall befall them; so that they will say in that day, Are not these evils come upon us, because our God is not among us?
Joshua 9:7 And the men of Israel said unto the Hivites, Peradventure ye dwell among us; and how shall we make a league with you?
Joshua 9:22 And Joshua called for them, and he spake unto them, saying, Wherefore have ye beguiled us, saying, We are very far from you; when ye dwell among us?
Joshua 22:19 Notwithstanding, if the land of your possession be unclean, then pass ye over unto the land of the possession of the Lord, wherein the Lord's tabernacle dwelleth, and take possession among us: but rebel not against the Lord, nor rebel against us, in building you an altar beside the altar of the Lord our God.
Joshua 22:31 And Phinehas the son of Eleazar the priest said unto the children of Reuben, and to the children of Gad, and to the children of Manasseh, This day we perceive that the Lord is among us, because ye have not committed this trespass against the Lord: now ye have delivered the children of Israel out of the hand of the Lord.
Judges 18:25 And the children of Dan said unto him, Let not thy voice be heard among us, lest angry fellows run upon thee, and thou lose thy life, with the lives of thy household.
1 Samuel 4:3 And when the people were come into the camp, the elders of Israel said, Wherefore hath the Lord smitten us to day before the Philistines? Let us fetch the ark of the covenant of the Lord out of Shiloh unto us, that, when it cometh among us, it may save us out of the hand of our enemies.
1 Kings 5:6 Now therefore command thou that they hew me cedar trees out of Lebanon; and my servants shall be with thy servants: and unto thee will I give hire for thy servants according to all that thou shalt appoint: for thou knowest that there is not among us any that can skill to hew timber like unto the Sidonians.
Job 34:37 For he addeth rebellion unto his sin, he clappeth his hands among us, and multiplieth his words against God.
Psalm 74:9 We see not our signs: there is no more any prophet: neither is there among us any that knoweth how long.
Proverbs 1:14 Cast in thy lot among us; let us all have one purse:
Isaiah 33:14 The sinners in Zion are afraid; fearfulness hath surprised the hypocrites. Who among us shall dwell with the devouring fire? who among us shall dwell with everlasting burnings?
Micah 3:11 The heads thereof judge for reward, and the priests thereof teach for hire, and the prophets thereof divine for money: yet will they lean upon the Lord, and say, Is not the Lord among us? none evil can come upon us.
Luke 1:1 Forasmuch as many have taken in hand to set forth in order a declaration of those things which are most surely believed among us,
Luke 7:16 And there came a fear on all: and they glorified God, saying, That a great prophet is risen up among us; and, That God hath visited his people.
John 1:14 And the Word was made flesh, and dwelt among us, (and we beheld his glory, the glory as of the only begotten of the Father,) full of grace and truth.
Acts 1:21 Wherefore of these men which have companied with us all the time that the Lord Jesus went in and out among us,
Acts 15:7 And when there had been much disputing, Peter rose up, and said unto them, Men and brethren, ye know how that a good while ago God made choice among us, that the Gentiles by my mouth should hear the word of the gospel, and believe.