-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
72 lines (67 loc) · 2.49 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<title>Search Engine Links Generator</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
textarea {
margin: 20px 0;
width: 300px;
height: 200px;
}
#links {
width: 300px;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.term {
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>Enter list of search terms, one on each row</h1>
<textarea id="terms"></textarea>
<button onclick="generateLinks()">Search</button>
<div id="links"></div>
<script>
const facebook_base_url = "https://www.facebook.com/search/top/?q=";
const twitter_base_url = "https://twitter.com/search?q=";
const vk_base_url = "https://vk.com/search?c%5Bq%5D=";
const google_base_url = "https://www.google.com/search?q=";
const yandex_base_url = "https://yandex.com/search/?text=";
function generateLinks() {
const searchTerms = document.getElementById('terms').value.split('\n');
const linksDiv = document.getElementById('links');
linksDiv.innerHTML = '';
searchTerms.forEach(term => {
const encodedTerm = encodeURIComponent(term.trim());
const facebook_link = facebook_base_url + encodedTerm;
const twitter_link = twitter_base_url + encodedTerm;
const vk_link = vk_base_url + encodedTerm;
const google_link = google_base_url + encodedTerm;
const yandex_link = yandex_base_url + encodedTerm;
const p = document.createElement('p');
p.className = 'term';
p.innerHTML = `Search term: <strong>${term}</strong><br>
<a href="${facebook_link}" target="_blank">Facebook</a> |
<a href="${twitter_link}" target="_blank">Twitter</a> |
<a href="${vk_link}" target="_blank">VK</a> |
<a href="${google_link}" target="_blank">Google</a> |
<a href="${yandex_link}" target="_blank">Yandex</a>`;
linksDiv.appendChild(p);
});
}
</script>
</body>
</html>