Skip to content

Commit

Permalink
justWatchTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 15, 2023
1 parent f911cb3 commit fb1de37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions justWatchTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
async function getMovieInfo(movieTitle) {
let locale = "en_US";
const url = `https://apis.justwatch.com/content/titles/${locale}/popular?language=en&body={"page_size":1,"page":1,"query":"${movieTitle}","content_types":["show","movie"]}`;
const response = await fetch(encodeURI(url));
const data = await response.json();
console.log(data);
const loc = data.items[0].full_path;
const opts = { url: `https://www.justwatch.com${loc}` };
console.log(opts);
}

let movieTitle = "Three Thousand Years of Longing";
getMovieInfo(movieTitle);

0 comments on commit fb1de37

Please sign in to comment.