Skip to content

Commit

Permalink
feat: 自动点赞特定用户
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Sep 2, 2024
1 parent e6069ca commit e2340d4
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions index_specific_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
localStorage.setItem("autoLikeEnabled", "false"); //默认关闭自动点赞
console.log("执行了初始数据更新操作");
}
let scrollInterval = null;
let checkScrollTimeout = null;


function getLatestTopic() {
let lastOffset = Number(localStorage.getItem("lastOffset")) || 0;
Expand Down Expand Up @@ -140,6 +139,8 @@

// 使用 post_id 生成 URL 并导航
window.location.href = `${BASE_URL}/t/topic/${post.topic_id}/${post.post_number}`;
} else {
console.error("未能获取到新的帖子数据。");
}
}

Expand Down Expand Up @@ -209,8 +210,10 @@
);
if (localStorage.getItem("read") === "true") {
console.log("点赞开始");
openSpecificUserPost();
likeSpecificPost();
setTimeout(() => {
openSpecificUserPost();
}, 1000);
}
});

Expand Down Expand Up @@ -265,14 +268,6 @@
localStorage.setItem("read", newReadState.toString());
button.textContent = newReadState ? "停止阅读" : "开始阅读";
if (!newReadState) {
if (scrollInterval !== null) {
clearInterval(scrollInterval);
scrollInterval = null;
}
if (checkScrollTimeout !== null) {
clearTimeout(checkScrollTimeout);
checkScrollTimeout = null;
}
localStorage.removeItem("navigatingToNextTopic");
} else {
if (BASE_URL == "https://linux.do") {
Expand Down Expand Up @@ -301,7 +296,7 @@
saveUserButton.textContent = "保存用户ID";
saveUserButton.style.position = "fixed";
saveUserButton.style.bottom = "50px";
saveUserButton.style.left = "150px";
saveUserButton.style.left = "10px";
saveUserButton.style.zIndex = "1000";
saveUserButton.style.backgroundColor = "#f0f0f0";
saveUserButton.style.color = "#000";
Expand Down

0 comments on commit e2340d4

Please sign in to comment.