From 6dc65275a2c9053a61f04f9acab05405088909c6 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Tue, 24 Dec 2024 03:30:45 -0600 Subject: [PATCH] New keyword, prevent duplication --- constants.js | 2 +- scraper.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/constants.js b/constants.js index 2381226..6f4af83 100644 --- a/constants.js +++ b/constants.js @@ -1,7 +1,7 @@ import * as path from "path" import { fileURLToPath } from "url" -export const flavors = ["#reflectivedetective", "#alearfred"] +export const flavors = ["#reflectivedetective", "#alearfred", "リュアル"] export const variety = 200 export const PORT = process.env.PORT || 8080 export const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/scraper.js b/scraper.js index 9b3d392..be7147b 100644 --- a/scraper.js +++ b/scraper.js @@ -13,7 +13,9 @@ export async function scrapeYaoi() { var search = scraper.searchTweets(flavor, variety, "media") for await (var value of search) { - if (value.html.includes("img")) { + // console.log(finalArray.includes(value)) + if (value.html.includes("img") & !finalArray.includes(value)) { + // console.log(value) finalArray.push(value) } }