Spaces:
Running
Running
Update index.html
Browse files- index.html +17 -9
index.html
CHANGED
@@ -5,25 +5,33 @@
|
|
5 |
<title>Bulk Website Opener</title>
|
6 |
<style>
|
7 |
body { font-family: sans-serif; padding: 20px; }
|
8 |
-
textarea { width: 100%;
|
|
|
9 |
button { padding: 10px 20px; margin-top: 10px; font-size: 16px; }
|
10 |
</style>
|
11 |
</head>
|
12 |
<body>
|
13 |
<h2>Bulk Website Opener</h2>
|
14 |
<p>Enter one URL per line (include https://):</p>
|
15 |
-
<textarea id="urls" placeholder="https://example.com"></textarea
|
|
|
|
|
16 |
<button onclick="openWebsites()">Open Websites</button>
|
17 |
|
18 |
<script>
|
19 |
function openWebsites() {
|
20 |
-
const urls = document.getElementById("urls").value.split('\n');
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
27 |
});
|
28 |
}
|
29 |
</script>
|
|
|
5 |
<title>Bulk Website Opener</title>
|
6 |
<style>
|
7 |
body { font-family: sans-serif; padding: 20px; }
|
8 |
+
textarea, input { width: 100%; margin-top: 10px; }
|
9 |
+
textarea { height: 200px; }
|
10 |
button { padding: 10px 20px; margin-top: 10px; font-size: 16px; }
|
11 |
</style>
|
12 |
</head>
|
13 |
<body>
|
14 |
<h2>Bulk Website Opener</h2>
|
15 |
<p>Enter one URL per line (include https://):</p>
|
16 |
+
<textarea id="urls" placeholder="https://example.com"></textarea>
|
17 |
+
<p>Number of websites to open at once:</p>
|
18 |
+
<input type="number" id="limit" placeholder="e.g. 5" min="1"><br>
|
19 |
<button onclick="openWebsites()">Open Websites</button>
|
20 |
|
21 |
<script>
|
22 |
function openWebsites() {
|
23 |
+
const urls = document.getElementById("urls").value.split('\n').map(url => url.trim()).filter(Boolean);
|
24 |
+
const limit = parseInt(document.getElementById("limit").value, 10);
|
25 |
+
|
26 |
+
if (isNaN(limit) || limit <= 0) {
|
27 |
+
alert("Please enter a valid number greater than 0.");
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
const toOpen = urls.slice(0, limit);
|
32 |
+
toOpen.forEach(url => {
|
33 |
+
const finalUrl = url.startsWith("http") ? url : "https://" + url;
|
34 |
+
window.open(finalUrl, '_blank');
|
35 |
});
|
36 |
}
|
37 |
</script>
|