Skip to content

Commit 8ec4444

Browse files
Add HTML file for search redirect functionality
1 parent b2571d6 commit 8ec4444

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

webapps/auto_searcher/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Search Redirect</title>
6+
</head>
7+
<body>
8+
<p>Redirecting…</p>
9+
<script>
10+
if (!sessionStorage.getItem('redirected')) {
11+
sessionStorage.setItem('redirected', '1');
12+
13+
const keywords = [
14+
'javascript', 'python', 'algorithm', 'database', 'cloud',
15+
'security', 'machine learning', 'design', 'framework', 'api',
16+
'testing', 'deployment', 'container', 'microservice', 'frontend',
17+
'backend', 'mobile', 'analytics', 'optimization', 'architecture',
18+
'network', 'cryptography', 'compiler', 'debugging', 'performance'
19+
];
20+
21+
const count = Math.floor(Math.random() * 3) + 3; // 3, 4, or 5
22+
const shuffled = keywords.sort(() => Math.random() - 0.5);
23+
const selected = shuffled.slice(0, count);
24+
const query = selected.join(' ');
25+
26+
window.location.href =
27+
'https://www.bing.com/search?q=' + encodeURIComponent(query);
28+
}
29+
</script>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)