Skip to content

Instantly share code, notes, and snippets.

@UltiRequiem
Created December 10, 2025 17:56
Show Gist options
  • Select an option

  • Save UltiRequiem/93f15767ba93913fcd36a175841ace78 to your computer and use it in GitHub Desktop.

Select an option

Save UltiRequiem/93f15767ba93913fcd36a175841ace78 to your computer and use it in GitHub Desktop.
export interface Payload {
original: string;
short: string;
createdAt: string;
}
const generateRandomUrl = (): string => {
const protocols = ['https://', 'http://'];
const domains = ['example.com', 'test.com', 'demo.org', 'sample.net', 'random.io', 'site.co', 'web.dev', 'app.ai'];
const paths = ['/', '/home', '/about', '/contact', '/products', '/services', '/blog', '/api/data', '/user/profile'];
const protocol = protocols[Math.floor(Math.random() * protocols.length)];
const domain = domains[Math.floor(Math.random() * domains.length)];
const path = paths[Math.floor(Math.random() * paths.length)];
return `${protocol}${domain}${path}`;
};
const makePostRequests = async (count: number) => {
const targetUrl = 'https://goto.crydafan.xyz/';
let successCount = 0;
let errorCount = 0;
console.log(`Starting ${count} POST requests to ${targetUrl}...`);
for (let i = 0; i < count; i++) {
try {
const randomUrl = generateRandomUrl();
const response = await fetch(targetUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: randomUrl })
});
if (response.ok) {
successCount++;
} else {
errorCount++;
console.error(`Request ${i + 1} failed with status: ${response.status}`);
}
// Log progress every 100 requests
if ((i + 1) % 100 === 0) {
console.log(`Progress: ${i + 1}/${count} requests completed`);
}
} catch (error) {
errorCount++;
console.error(`Request ${i + 1} error:`, error);
}
}
console.log(`\nCompleted!`);
console.log(`Success: ${successCount}`);
console.log(`Errors: ${errorCount}`);
};
// Execute 10,000 POST requests
makePostRequests(10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment