From e5aee788b8c3bb1e268bf2fc672fbb61c8992f04 Mon Sep 17 00:00:00 2001 From: AllTrueVision <85555604+AllTrueVision@users.noreply.github.com> Date: Tue, 1 Apr 2025 23:30:02 -0400 Subject: [PATCH] work, not my best work --- index.html | 12 ++++++++++++ main.js | 19 +++++++++++++++++++ style.css | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 index.html create mode 100644 main.js create mode 100644 style.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..3809f21 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + Film-Fest of the Forgotten + + + Whose Movie Do You Remember Seeing? +

""

+ + \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..25c9c66 --- /dev/null +++ b/main.js @@ -0,0 +1,19 @@ +let findOut = document.querySelector('button').addEventListener('click', filmData) +function filmData(){ + let whichFilm = document.querySelector('input') + let film = whichFilm.value + fetch('https://www.omdbapi.com/?t=${film}&apikey=23535c7f') + .then(res => res.json()) + .then(data =>{ + let directorName = data.directorName + fetch('https://api.themoviedb.org/3/search/person?query=${directorName}&api_key=078bf2110c6f30aad994aa5c4d03fcec') + .then(res => res.json()) + .then(data = { + console.log(data) + document.querySelector('h1').innerText = '${"The Director of" + film + "also made:" + data.results[0].known_for[1].title}' + }) + .catch(err =>{ + console.log('error ${err}') + }) + }) +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..e6923bb --- /dev/null +++ b/style.css @@ -0,0 +1,3 @@ +*{ + box-sizing: border-box; +} \ No newline at end of file