Skip to content

Commit

Permalink
first showing of ratings work
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 15, 2023
1 parent ee4a4de commit 7550113
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
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 justWatchURL = "https://www.justwatch.com" + data.items[0].full_path;
// flatrate = free with subscription (netflix, amazon prime, disney+)
let offers = data.items[0].offers.filter((x) => x.monetization_type == "flatrate" && (x.package_short_name == "amp" || x.package_short_name == "nfx" || x.package_short_name == "dnp"));
Expand Down Expand Up @@ -479,23 +478,23 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
}
}

getMovieInfo("Lucifer").then((data) => {
console.log(data);
});
// getMovieInfo("Lucifer").then((data) => {
// console.log(data);
// });
async function Netflix_JustWatch() {
console.log("JustWatch");
let titleCards = document.querySelectorAll(".title-card .boxart-container");
titleCards.forEach((card) => {
let title = card.children?.[1]?.firstChild.textContent;
if (title) {
// getMovieInfo(title).then((data) => {
let div = document.createElement("div");
div.style = "position: absolute;top: 0;left: 50px;z-index: 9999;color: black;background: grey;";
div.id = "justWatch";
// div.textContent = title + " " + data.scoring?.value;
div.textContent = title;
card.appendChild(div);
// });
getMovieInfo(title).then((data) => {
let div = document.createElement("div");
div.style = "position: absolute;top: 0;left: 50px;z-index: 9999;color: black;background: grey;";
div.id = "justWatch";
div.textContent = title + " " + data.scoring?.value;
// div.textContent = title;
card.appendChild(div);
});
}
});
}
Expand Down

0 comments on commit 7550113

Please sign in to comment.