gggg / templates /Google.html
enotkrutoy's picture
Rename templates/Google to templates/Google.html
1007cb2 verified
raw
history blame
4.74 kB
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Поиск в Google</title>
<style>
body {
background-color: #1a1a1a;
color: #ffffff;
font-family: Arial, sans-serif;
}
.container {
margin: 20px;
text-align: center;
padding: 20px;
border-radius: 10px;
background-color: #2d2d2d;
box-shadow: 0 0 15px rgba(0,0,0,0.3);
}
input[type="text"], select {
width: 30%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 4px;
box-sizing: border-box;
background-color: #333333;
color: #ffffff;
}
input[type="text"]:focus, select:focus {
outline: none;
border-color: #4CAF50;
}
button[type="submit"] {
width: 10%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-image 0.3s;
background-image: linear-gradient(to bottom, #4CAF50, #45a049);
}
button[type="submit"]:hover {
background-image: linear-gradient(to bottom, #45a049, #4CAF50);
}
.success {
color: #4CAF50;
margin-top: 10px;
font-weight: bold;
}
.error {
color: #f44336;
margin-top: 10px;
font-weight: bold;
}
.container img {
width: 100px;
margin: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
</style>
</head>
<body>
<div class="container">
<img src="https://i.pinimg.com/originals/bc/e4/c0/bce4c082e2a1c2ec016351228f782a4a.gif" alt="Logo"/>
<form id="searchForm">
<input id="searchInput" type="text" placeholder="Введите ваш запрос для поиска"/>
<button type="submit">Поиск</button>
</form>
<div id="message"></div>
</div>
<script>
document.getElementById('searchForm').addEventListener('submit', function(e) {
e.preventDefault();
const searchQuery = document.getElementById('searchInput').value;
searchGoogle(searchQuery);
});
function searchGoogle(search) {
if (typeof search !== 'string' || search.trim() === '') {
console.error('Поисковый запрос должен быть строкой и не должен быть пустым.');
return;
}
const words = search.split(" ").filter(Boolean);
const wordsCount = words.length;
if (wordsCount >= 32) {
console.error('Количество слов в поисковом запросе должно быть меньше 32.');
return;
}
const o = 32 - wordsCount;
if (o <= 0) {
console.error('Ошибка в расчете o.');
return;
}
const template = "site:*.*.%NUM%.* |";
let query = "";
const urls = [];
const maxUrls = 10; // Ограничение количества URL для предотвращения блокировки
try {
for (let i = 0; i < Math.floor(256 / o) && i < maxUrls; i++) {
query = "";
for (let ii = 0; ii < (257 - (i * o)); ii++) {
query += template.replace("%NUM%", ii);
}
query = query.slice(0, -1);
query = `(${search}) (${query})`;
const url = `https://www.google.com/search?q=${encodeURIComponent(query)}`;
urls.push(url);
}
// Открываем URL с задержкой для предотвращения блокировки
urls.forEach((url, index) => {
setTimeout(() => {
window.open(url, '_blank', 'noreferrer');
}, index * 1000); // Задержка 1 секунда между открытием вкладок
});
} catch (error) {
console.error('Произошла ошибка:', error);
}
}
</script>
</body>
</html>