From 0fe91973f404d173be3283b6816a848a01aa72f5 Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Sun, 22 Sep 2024 22:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B0=B7=E6=AD=8C=E6=96=B0?= =?UTF-8?q?=E9=97=BB=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/popup.js | 6 +++--- lib/content.js | 31 ++++++++++++++++++++++++++++--- popup.html | 2 +- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/js/popup.js b/js/popup.js index 4ca9dff..7ad7efe 100644 --- a/js/popup.js +++ b/js/popup.js @@ -62,10 +62,10 @@ $(function () { }); //函数队列 let queue = [ - // { url: "https://www.youtube.com/watch?v=LZ7DMB6h-hs", tip: "youtube" }, - // { url: "https://shopping.google.com/", tip: "shopping" }, + { url: "https://www.youtube.com/watch?v=LZ7DMB6h-hs", tip: "youtube" }, + { url: "https://shopping.google.com/", tip: "shopping" }, { url: "https://play.google.com/", tip: "play_google" }, - // { url: "https://news.google.com/", tip: "news_google" }, + { url: "https://news.google.com/", tip: "news_google" }, ]; //当前执行的队列索引 diff --git a/lib/content.js b/lib/content.js index faf8f89..d4b9811 100644 --- a/lib/content.js +++ b/lib/content.js @@ -156,11 +156,35 @@ async function news_google(r, id) { //等待五秒怕加载速度过慢 await delay(3); //滑动次数 - let sum = getRandomInt(10, 50); + let sum = getRandomInt(5, 9); for (let index = 0; index < sum; index++) { RandomIntscrollBy(); await delay(getRandomInt(5, 10)); } + let news_array = $(".cDgn2c"); + //随机点击模块 + news_array[getRandomInt(0, news_array.length - 1)].click(); + for (let index = 0; index < getRandomInt(3, 8); index++) { + RandomIntscrollBy(); + await delay(getRandomInt(3, 8)); + } + let new_array = $(".VDXfz"); + let new_array_href = []; + for (let index = 0; index < new_array.length; index++) { + const element = new_array[index]; + console.log(element.getAttribute("href")); + let url = element.getAttribute("href").replace(/\./g, ""); + new_array_href.push(`https://news.google.com${url}`); + } + // for (let index = 0; index < new_array_href.length; index++) { + //这里只打开4个链接太多了有毒 + for (let index = 0; index < 4; index++) { + const element = new_array_href[index]; + let a = open(element); + // console.log(JSON.stringify(a)) + await delay(3); + a.close(); + } send_close(id); } //谷歌商店浏览 @@ -180,7 +204,7 @@ async function play_google(r, id) { try { popular_games[getRandomInt(0, popular_games.length - 1)].click(); } catch (error) { - console.log(error) + console.log(error); } let a = getRandomInt(3, 5); for (let index = 0; index < a; index++) { @@ -252,12 +276,13 @@ chrome.runtime.sendMessage( { name: "play_google", funct: play_google }, { name: "shopping", funct: shopping }, ]; - + let is_Match = false; for (let index = 0; index < functoons.length; index++) { // const element = functoons[index]; let name = functoons[index].name; let funct = functoons[index].funct; if (r == name) { + is_Match = true; funct(r, id); } } diff --git a/popup.html b/popup.html index 9e029a7..c69bbbc 100644 --- a/popup.html +++ b/popup.html @@ -17,7 +17,7 @@ -
+

谷歌养号脚本手机版