first commit
This commit is contained in:
47
rosie/app.js
Normal file
47
rosie/app.js
Normal file
@@ -0,0 +1,47 @@
|
||||
document.querySelector('#search-form').addEventListener('submit', (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Submit Triggered");
|
||||
const searchInput = document.querySelector("#search-field").value;
|
||||
console.log(searchInput);
|
||||
let queryPlus = searchInput.replace(/ /g, '+');
|
||||
console.log(queryPlus);
|
||||
let queryUnderscore = searchInput.replace(/ /g, '_');
|
||||
console.log(queryUnderscore);
|
||||
if (searchInput.startsWith("/")) {
|
||||
console.log('Slash Command Triggered');
|
||||
if (searchInput.startsWith("/c")) {
|
||||
let initialChargeSearch = "https://initialcharge.net/?s=" + queryPlus.replace('/c+', '');
|
||||
console.log(initialChargeSearch);
|
||||
window.location.href = initialChargeSearch;
|
||||
}
|
||||
if (searchInput.startsWith("/i")) {
|
||||
let invidiousSearch = "https://video.libertynode.org/search?q=" + queryPlus.replace('/i+', '');
|
||||
console.log(invidiousSearch);
|
||||
window.location.href = invidiousSearch;
|
||||
}
|
||||
if (searchInput.startsWith("/o")) {
|
||||
let odyseeSearch = "https://odysee.com/$/search?q=" + queryPlus.replace('/o+', '');
|
||||
console.log(odyseeSearch);
|
||||
window.location.href = odyseeSearch;
|
||||
}
|
||||
if (searchInput.startsWith("/p")) {
|
||||
let podcastSearch = "https://podcastindex.org/search?q=" + queryPlus.replace('/p+', '');
|
||||
console.log(podcastSearch);
|
||||
window.location.href = podcastSearch;
|
||||
}
|
||||
if (searchInput.startsWith("/s")) {
|
||||
let songSearch = "https://odesli.co/?q=" + queryPlus.replace('/s+', '');
|
||||
console.log(songSearch);
|
||||
window.location.href = songSearch;
|
||||
}
|
||||
if (searchInput.startsWith("/t")) {
|
||||
let tpbSearch = "https://thepiratebay.org/search.php?q=" + queryPlus.replace('/t+', '');
|
||||
console.log(tpbSearch);
|
||||
window.location.href = tpbSearch;
|
||||
}
|
||||
} else {
|
||||
let braveSearch = "https://search.brave.com/search?q=%s".replace('%s', queryPlus);
|
||||
console.log(braveSearch);
|
||||
window.location.href = braveSearch;
|
||||
}
|
||||
})
|
27
rosie/index.html
Normal file
27
rosie/index.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Rosie</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="search-form">
|
||||
<input type="text" id="search-field" name="Search">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
<details>
|
||||
<summary>Info</summary>
|
||||
<ul>
|
||||
<li><code>/c</code> — Initial Charge</li>
|
||||
<li><code>/i</code> — Invidious</li>
|
||||
<li><code>/o</code> — Odysee</li>
|
||||
<li><code>/p</code> — Podcast Index</li>
|
||||
<li><code>/s</code> — Song.link</li>
|
||||
<li><code>/t</code> — The Pirate Bay</li>
|
||||
<li>Fallback: Brave Search</li>
|
||||
</ul>
|
||||
</details>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user