Skip to content

Commit

Permalink
Fix: Enhanced search feature (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Mar 3, 2024
1 parent 8d89358 commit ba27fc9
Show file tree
Hide file tree
Showing 30 changed files with 474 additions and 1,323 deletions.
20 changes: 19 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,24 @@ <h1 id="my-heading" style="margin-bottom: -10px">
</script>

<script>
const movieCode = {
part1: 'YzVhMjBjODY=',
part2: 'MWFjZjdiYjg=',
part3: 'ZDllOTg3ZGNjN2YxYjU1OA=='
};

function getMovieVerseData(input) {
return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103);
}

function generateMovieNames(input) {
return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61);
}

function getMovieCode() {
return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3);
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('search').addEventListener('input', function(e) {
const viewAllResultsBtn = document.getElementById('view-all-results');
Expand All @@ -470,7 +488,7 @@ <h1 id="my-heading" style="margin-bottom: -10px">
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
20 changes: 19 additions & 1 deletion MovieVerse-Frontend/html/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,24 @@ <h1 id="my-heading" style="margin-bottom: -10px">
</script>

<script>
const movieCode = {
part1: 'YzVhMjBjODY=',
part2: 'MWFjZjdiYjg=',
part3: 'ZDllOTg3ZGNjN2YxYjU1OA=='
};

function getMovieVerseData(input) {
return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103);
}

function generateMovieNames(input) {
return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61);
}

function getMovieCode() {
return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3);
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('search').addEventListener('input', function(e) {
const viewAllResultsBtn = document.getElementById('view-all-results');
Expand All @@ -474,7 +492,7 @@ <h1 id="my-heading" style="margin-bottom: -10px">
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
2 changes: 1 addition & 1 deletion MovieVerse-Frontend/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ <h3 id="subheading">Useful Links:</h3>
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
2 changes: 1 addition & 1 deletion MovieVerse-Frontend/html/actor-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ <h2 id="actor-name" class="actor-header"></h2>
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
14 changes: 13 additions & 1 deletion MovieVerse-Frontend/html/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ <h2 class="chart-title">Movie Releases by Countries</h2>
</script>

<script>
function getMovieVerseData(input) {
return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103);
}

function generateMovieNames(input) {
return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61);
}

function getMovieCode() {
return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3);
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('search').addEventListener('input', function(e) {
const viewAllResultsBtn = document.getElementById('view-all-results');
Expand All @@ -226,7 +238,7 @@ <h2 class="chart-title">Movie Releases by Countries</h2>
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
22 changes: 20 additions & 2 deletions MovieVerse-Frontend/html/api_fails.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ <h1 id="my-heading" style="margin-bottom: -10px">
}
</script>

<footer>
<footer style="margin-top: 500px">
<a href="../../index.html" style="cursor: pointer; text-decoration: none">
<p style="cursor: pointer; text-decoration: none">© 2024 The MovieVerse. All rights reserved.</p>
</a>
Expand Down Expand Up @@ -466,6 +466,24 @@ <h1 id="my-heading" style="margin-bottom: -10px">
</script>

<script>
const movieCode = {
part1: 'YzVhMjBjODY=',
part2: 'MWFjZjdiYjg=',
part3: 'ZDllOTg3ZGNjN2YxYjU1OA=='
};

function getMovieVerseData(input) {
return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103);
}

function generateMovieNames(input) {
return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61);
}

function getMovieCode() {
return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3);
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('search').addEventListener('input', function(e) {
const viewAllResultsBtn = document.getElementById('view-all-results');
Expand All @@ -475,7 +493,7 @@ <h1 id="my-heading" style="margin-bottom: -10px">
viewAllResultsBtn.style.display = query ? 'block' : 'none';

if (query) {
const searchURL = `https://api.themoviedb.org/3/search/multi?api_key=c5a20c861acf7bb8d9e987dcc7f1b558&query=${encodeURIComponent(query)}`;
const searchURL = `https://${getMovieVerseData()}/3/search/multi?${generateMovieNames()}${getMovieCode()}&query=${encodeURIComponent(query)}`;
fetch(searchURL)
.then(response => response.json())
.then(data => {
Expand Down
Loading

0 comments on commit ba27fc9

Please sign in to comment.