Skip to content

Commit

Permalink
attempts to fix facebook duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
steveseguin committed Mar 20, 2024
1 parent efd860a commit afa1c76
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
}
}


// <div aria-label="Link preview" aria-modal="true" role="dialog"



function getAllContentNodes(element) { // takes an element.
var resp = "";

Expand Down Expand Up @@ -88,7 +83,7 @@
return resp;
}


var dupCheck2 = [];

async function processMessage(ele) {
if (ele == window) {
Expand Down Expand Up @@ -200,8 +195,27 @@
data.type = "facebook";
}

console.log(data);

var entry = data.chatname + "+" + data.hasDonation + "+" + data.chatmessage;
var entryString = JSON.stringify(entry);

if (!dupCheck2.includes(entryString)) {
dupCheck2.push(entryString);

setTimeout(() => {
const index = dupCheck2.indexOf(entryString);
if (index > -1) {
dupCheck2.splice(index, 1);
}
}, 15000);

//console.log(data);
} else {
return;
}
// console.log([...dupCheck2]);

//console.warn(data);
pushMessage(data);
}

Expand Down Expand Up @@ -269,6 +283,7 @@

var dupCheck = [];


var lastURL = "";
var processed = 0;

Expand Down

0 comments on commit afa1c76

Please sign in to comment.