Skip to content

Commit

Permalink
Merge pull request #1 from anon-123456789/main
Browse files Browse the repository at this point in the history
Replace with JS version
  • Loading branch information
astoko authored Mar 23, 2024
2 parents a4bb9b4 + 1e615fa commit d0a5288
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 56 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@ Its to make this counter above go to 999,999,999 and see what happens.. maybe we

## Demo

![Screencast-from-2024-03-23-19-35-30](https://github.com/Kokolekion/CounterProject/assets/65463088/b7b7f94b-7a6d-4465-8cdd-97992e36d82b)
![The script running on macOS](demo.gif)

## Installation
A Linux/macOS environment is preferred. You can use WSL if you're running Windows

Install the following dependencies:
**Requests**
**[Bun](https://bun.sh)**

```bash
pip install requests
curl -fsSL https://bun.sh/install | bash
```
Node.js would be used for this, but Bun is faster.

# Running
```bash
./run.sh
```

## Contributors
Expand All @@ -37,12 +44,17 @@ and everyone running this code for some reason XD

#### Is this fastest way possible to complete this project?

Most probably not but i sure hope someday we get better and faster ways of doing this! XD
Most probably not but ~~i sure hope someday we get better and faster ways of doing this!~~ the new js version is faster than the python one, but could still be faster XD

#### Why is there both `run.sh` and `spam.js`?
Running `bun spam.js` will work, but bun seems to constantly memory leak, hogging gigabytes of memory. `run.sh` waits 60 seconds and

#### Is this safe, Will i get in trouble of sending so many requests?

Yes, the owner of the site has said that its okay, From the owner: "break this :3"

#### Is the code AI generated?
Yes.

## Licenses Used

Expand Down
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

# Function to handle SIGINT signal (Ctrl+C)
sigint_handler() {
# Kill the process if it's running
if [ -n "$process_id" ]; then
kill "$process_id"
fi
exit 0
}

# Trap SIGINT signal (Ctrl+C) and call sigint_handler function
trap sigint_handler SIGINT

# Infinite loop
while :
do
# Start the process (replace "your_process_command" with the actual command)
bun spam.js &

# Get the process ID of the last background process
process_id=$!

# Wait for 1 minute
sleep 60

# Kill the process
kill $process_id

# Optionally, wait for a brief moment to ensure the process is killed before restarting
sleep 1
done
30 changes: 30 additions & 0 deletions spam.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const http = require('http');

let requestsSent = 0;

function sendRequest(url) {
const options = {
headers: {
'Referer': 'https://whathow.neocities.org'
}
};

http.get(url, options, (res) => {
console.log(`Request to ${url} - Status code: ${res.statusCode}`);
requestsSent++;
console.log(`${requestsSent} requests sent so far.`);
}).on('error', (err) => {
console.error(`Error sending request: ${err.message}`);
});
}

function continuousRequests(url) {
setInterval(() => {
for (let i = 0; i < 50; i++) {
sendRequest(url);
}
}, 100);
}

const url = "https://counter11.freecounterstat.com/private/counter.php?c=pdz4dufhlf9qlk4krksnw7twxbhlez2e&init=1711161297330&init_freecounterstat=0&library=library_counters&coef=0.75&type=193&lenght=9&pv=0";
continuousRequests(url);
52 changes: 0 additions & 52 deletions spam.py

This file was deleted.

0 comments on commit d0a5288

Please sign in to comment.