Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ const readyStateCheckInterval = setInterval(function () {

click_count++;
state = _STATE_TASK_STARTED;
wait_time = generateRandom(90, 12);
wait_time = generateRandom(12, 90);
chrome.runtime.sendMessage({action: "setActType", actType: config.actionType});
} else {
wait_time = generateRandom(5, 10);
Expand Down
41 changes: 39 additions & 2 deletions networks/reddit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ function do_reddit_like() {
state = _STATE_WAIT_TO_CLOSE;
wait_time = generateRandom(5, 8);

let btn = document.querySelector('button[aria-label="upvote"]');
const upvoteSelectors = [
'button[aria-label="upvote"]',
'button[data-testid="upvote"]',
'button[aria-label="upvote"] svg',
'.voteButton[data-click-label="upvote"]',
'button[name="upvote"]',
'button[data-adclicklocation="upvote"]'
];

let btn = null;
for (const sel of upvoteSelectors) {
btn = document.querySelector(sel);
if (btn) break;
}

if (!btn) {
console.log("like button not found !");
Expand All @@ -31,7 +44,31 @@ function do_reddit_follow() {
state = _STATE_WAIT_TO_CLOSE;
wait_time = generateRandom(5, 8);

let btn = document.querySelector('button._1LHxa-yaHJwrPK8kuyv_Y4');
const followSelectors = [
'button._1LHxa-yaHJwrPK8kuyv_Y4',
'button[data-testid="subscribe-button"]',
'button[aria-label="Join"]',
'button:contains("Join")',
'button.join-button',
'button[data-click-location="sidebar"]'
];

let btn = null;
for (const sel of followSelectors) {
btn = document.querySelector(sel);
if (btn) break;
}

if (!btn) {
const joinBtns = document.querySelectorAll('button');
for (let i = 0; i < joinBtns.length; i++) {
if (joinBtns[i].textContent && joinBtns[i].textContent.trim() === 'Join') {
btn = joinBtns[i];
break;
}
}
}

if (!btn) {
console.log("follow button not found !");
return;
Expand Down
84 changes: 63 additions & 21 deletions networks/tiktok.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,86 @@
function do_tiktok_like() {

state = _STATE_WAIT_TO_CLOSE;
wait_time = generateRandom(5, 8);
wait_time = generateRandom(8, 12);

const likeSelectors = [
'div.engagement-icon-v23',
'span[data-e2e="like-icon"]',
'div[data-e2e="like-icon"]',
'button[aria-label="like"]',
'[data-e2e="like"]'
];

let likeBtn = null;
for (const sel of likeSelectors) {
likeBtn = document.querySelector(sel);
if (likeBtn) break;
}

// engagement-icon-v23
let div = document.querySelectorAll('div.engagement-icon-v23');
if ((!div) || (div.length < 1)) {
div = document.querySelectorAll('span[data-e2e="like-icon"]');
if (!likeBtn) {
console.log("like button not found !");
return false;
}

if ((div) && (div.length > 0)) {
console.log("Clicked !");
//div[0].click();
click(div[0]);
return true;
const isLiked = likeBtn.classList.contains('liked') ||
likeBtn.getAttribute('data-e2e-status') === 'liked' ||
likeBtn.querySelector('svg[fill]');

if (isLiked) {
console.log("Already liked, skipping");
return false;
}

return false;
console.log("Clicked like!");
click(likeBtn);
return true;
}

function do_tiktok_follow() {

state = _STATE_WAIT_TO_CLOSE;
wait_time = 6;
wait_time = generateRandom(8, 12);

const followSelectors = [
'button:contains("Follow")',
'[data-e2e="follow"]',
'button[data-e2e="follow-button"]',
'div[data-e2e="follow"]'
];

let btn = null;
for (const sel of followSelectors) {
btn = document.querySelector(sel);
if (btn) break;
}

const btns = document.getElementsByTagName("button");
if (!btns) {
return false;
if (!btn) {
const btns = document.getElementsByTagName("button");
if (!btns || btns.length < 1) {
return false;
}

for (let i = 0; i < btns.length; i++) {
if (btns[i].textContent === "Follow") {
btn = btns[i];
break;
}
}
}

if (btns.length < 1) {
if (!btn) {
console.log("follow button not found !");
return false;
}

for (let i = 0; i < btns.length; i++) {
if (btns[i].textContent === "Follow") {
click(btns[i]);
return true;
}
const isFollowing = btn.textContent === "Following" || btn.classList.contains('following');
if (isFollowing) {
console.log("Already following, skipping");
return false;
}

click(btn);
return true;
}

let tiktok_done = false;
Expand Down
32 changes: 30 additions & 2 deletions networks/twitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,37 @@ function do_twitch_sub() {
state = _STATE_WAIT_TO_CLOSE;
wait_time = generateRandom(5, 8);

let btn = document.querySelector('button[aria-label="Follow"]');
const followSelectors = [
'button[aria-label="Follow"]',
'button[aria-label="Follow"]',
'button[data-a-target="follow-button"]',
'button.follow-button',
'button:contains("Follow")'
];

let btn = null;
for (const sel of followSelectors) {
btn = document.querySelector(sel);
if (btn) break;
}

if (!btn) {
const btns = document.getElementsByTagName("button");
for (let i = 0; i < btns.length; i++) {
if (btns[i].textContent && btns[i].textContent.includes("Follow")) {
btn = btns[i];
break;
}
}
}

if (btn) {
btn.click();
const isFollowing = btn.textContent === "Following" || btn.classList.contains('following');
if (!isFollowing) {
btn.click();
} else {
console.log("Already following");
}
} else {
console.log("Follow button not found !");
}
Expand Down
33 changes: 23 additions & 10 deletions networks/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,32 @@ function do_yt_sub() {
state = _STATE_WAIT_TO_CLOSE;
wait_time = generateRandom(5, 8);

const buttons = document.querySelectorAll('.ytd-subscribe-button-renderer');
if ((!buttons) || (buttons.length < 1)) {
console.log("No Subscribe button found :()");
const selectors = [
'.yt-spec-button-shape-next--filled > div:nth-child(1)',
'.ytd-subscribe-button-renderer',
'ytd-subscribe-button-renderer',
'#subscribe-button'
];

let btn = null;
for (const sel of selectors) {
const elements = document.querySelectorAll(sel);
for (let i = 0; i < elements.length; i++) {
const s = elements[i].textContent;
if (s && s.trim() === 'Subscribe') {
btn = elements[i];
break;
}
}
if (btn) break;
}

if (!btn) {
console.log("No Subscribe button found");
return;
}

for (let i = 0; i < buttons.length; i++) {
const s = buttons[i].textContent;
if (s === 'Subscribe') {
buttons[i].click();
break;
}
}
btn.click();
}

let youtube_done = false;
Expand Down