Skip to content

Commit

Permalink
Merge pull request #9 from AlaaZenji/patch-1
Browse files Browse the repository at this point in the history
feat : added checks to video title and description
  • Loading branch information
PGgamer2 authored Jun 7, 2024
2 parents d396d7a + aca1590 commit 74afd2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ function isThisArickroll(rickLink) {
var vidTitle = videoInfos.items[0].snippet.title.replace(/ /g, '').toLowerCase();
var vidDescription = videoInfos.items[0].snippet.description.replace(/ /g, '').toLowerCase();

if (vidTitle.indexOf("rickroll") !== -1 || vidTitle.indexOf("nevergonnagiveyouup") !== -1) {
if (vidTitle.indexOf("rickroll") !== -1 || vidTitle.indexOf("nevergonnagiveyouup") !== -1 || vidTitle.indexOf("rickastley")!== -1 ) {
// Check if title contains any combination of "nevergonnagiveyouup"
RickDetected = 2;
} else if (vidDescription.indexOf("rickroll") !== -1 || vidDescription.indexOf("nevergonnagiveyouup") !== -1) {
} else if (vidDescription.indexOf("rickroll") !== -1 || vidDescription.indexOf("nevergonnagiveyouup" || vidTitle.indexOf("rickastley")!== -1) !== -1) {
// Check if description contains any combination of "nevergonnagiveyouup"
RickDetected = 2;
}
Expand Down Expand Up @@ -122,4 +122,4 @@ function DisplayRickRoll(ytID) {
document.getElementById("rickornot").innerHTML = resultMessages[RickDetected][0];
document.getElementById("rickornot").style.color = resultMessages[RickDetected][1];
}
}
}

0 comments on commit 74afd2d

Please sign in to comment.