Skip to content

Commit

Permalink
新增:Twitter任务识别[GiveeClub]
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Dec 12, 2022
1 parent fc31349 commit 9049949
Show file tree
Hide file tree
Showing 20 changed files with 168 additions and 102 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v4.2.23
name: 4.2.23
body: |-
- Keyhub反屏蔽ADB
- Keyhub任务识别优化
tag_name: v4.2.24
name: 4.2.24
body: '- GiveeClub新增Twitter任务识别'
files: |-
dist/auto-task-v4-for-giveawaysu.user.js
dist/auto-task-v4.compatibility.user.js
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.2.23
// @version 4.2.24
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -7393,6 +7393,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};
var _checkLogin = new WeakSet();
Expand Down Expand Up @@ -8640,12 +8644,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const tasks = $('.event-actions tr');
for (const task of tasks) {
pro.push(new Promise(resolve => {
var _$$find;
var _$$find, _$$find2;
const taskDes = $(task).find('.event-action-label a');
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
const taskName = taskDes.text().trim();
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
return resolve(true);
}
getRedirectLink(taskDes.attr('href')).then(taskLink => {
Expand Down Expand Up @@ -8684,6 +8689,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
this.undoneTasks.youtube.likeLinks.push(taskLink);
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
this.undoneTasks.vk.nameLinks.push(taskLink);
} else if (taskIcon.includes('twitter')) {
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
this.undoneTasks.twitter.userLinks.push(taskLink);
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
this.undoneTasks.twitter.retweetLinks.push(taskLink);
}
} else {
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
if (/follow.*button/gim.test(taskName)) {
Expand Down
30 changes: 15 additions & 15 deletions dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.2.23
// @version 4.2.24
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -7374,6 +7374,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};
var _checkLogin = new WeakSet();
Expand Down Expand Up @@ -8621,12 +8625,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const tasks = $('.event-actions tr');
for (const task of tasks) {
pro.push(new Promise(resolve => {
var _$$find;
var _$$find, _$$find2;
const taskDes = $(task).find('.event-action-label a');
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
const taskName = taskDes.text().trim();
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
return resolve(true);
}
getRedirectLink(taskDes.attr('href')).then(taskLink => {
Expand Down Expand Up @@ -8665,6 +8670,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
this.undoneTasks.youtube.likeLinks.push(taskLink);
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
this.undoneTasks.vk.nameLinks.push(taskLink);
} else if (taskIcon.includes('twitter')) {
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
this.undoneTasks.twitter.userLinks.push(taskLink);
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
this.undoneTasks.twitter.retweetLinks.push(taskLink);
}
} else {
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
if (/follow.*button/gim.test(taskName)) {
Expand Down
6 changes: 6 additions & 0 deletions doc/docs/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ lang: zh-CN

## V4.2

### V4.2.24

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.2.24)

- GiveeClub新增Twitter任务识别

### V4.2.23

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.2.23)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "auto-task-v4",
"version": "4.2.23",
"version": "4.2.24",
"change": [
"Keyhub反屏蔽ADB",
"Keyhub任务识别优化"
"新增:Twitter任务识别[GiveeClub]",
"优化"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions page/dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.2.23
// @version 4.2.24
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -7393,6 +7393,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};
var _checkLogin = new WeakSet();
Expand Down Expand Up @@ -8640,12 +8644,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const tasks = $('.event-actions tr');
for (const task of tasks) {
pro.push(new Promise(resolve => {
var _$$find;
var _$$find, _$$find2;
const taskDes = $(task).find('.event-action-label a');
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
const taskName = taskDes.text().trim();
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
return resolve(true);
}
getRedirectLink(taskDes.attr('href')).then(taskLink => {
Expand Down Expand Up @@ -8684,6 +8689,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
this.undoneTasks.youtube.likeLinks.push(taskLink);
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
this.undoneTasks.vk.nameLinks.push(taskLink);
} else if (taskIcon.includes('twitter')) {
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
this.undoneTasks.twitter.userLinks.push(taskLink);
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
this.undoneTasks.twitter.retweetLinks.push(taskLink);
}
} else {
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
if (/follow.*button/gim.test(taskName)) {
Expand Down
30 changes: 15 additions & 15 deletions page/dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions page/dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions page/dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.2.23
// @version 4.2.24
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -7374,6 +7374,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};
var _checkLogin = new WeakSet();
Expand Down Expand Up @@ -8621,12 +8625,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const tasks = $('.event-actions tr');
for (const task of tasks) {
pro.push(new Promise(resolve => {
var _$$find;
var _$$find, _$$find2;
const taskDes = $(task).find('.event-action-label a');
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
const taskName = taskDes.text().trim();
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
return resolve(true);
}
getRedirectLink(taskDes.attr('href')).then(taskLink => {
Expand Down Expand Up @@ -8665,6 +8670,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
this.undoneTasks.youtube.likeLinks.push(taskLink);
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
this.undoneTasks.vk.nameLinks.push(taskLink);
} else if (taskIcon.includes('twitter')) {
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
this.undoneTasks.twitter.userLinks.push(taskLink);
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
this.undoneTasks.twitter.retweetLinks.push(taskLink);
}
} else {
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
if (/follow.*button/gim.test(taskName)) {
Expand Down
5 changes: 2 additions & 3 deletions page/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "auto-task-v4",
"version": "4.2.23",
"version": "4.2.24",
"change": [
"Keyhub反屏蔽ADB",
"Keyhub任务识别优化"
"GiveeClub新增Twitter任务识别"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
Expand Down
8 changes: 6 additions & 2 deletions src/for_giveawaysu/Giveawaysu.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* @Author : HCLonely
* @Date : 2021-11-08 10:37:13
* @LastEditTime : 2022-05-18 10:00:20
* @LastEditTime : 2022-12-12 10:54:24
* @LastEditors : HCLonely
* @FilePath : /auto-task-new/src/for_giveawaysu/Giveawaysu.ts
* @Description : https://giveaway.su/
*/

// eslint-disable-next-line
/// <reference path = "GiveawaySu.d.ts" />
/// <reference path = "./Giveawaysu.d.ts" />

import Swal from 'sweetalert2';
import throwError from '../scripts/tools/throwError';
Expand Down Expand Up @@ -55,6 +55,10 @@ const defaultTasks: gasSocialTasks = {
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};

Expand Down
18 changes: 11 additions & 7 deletions src/scripts/website/Giveawaysu.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author : HCLonely
* @Date : 2021-11-08 10:43:23
* @LastEditTime : 2022-01-20 10:39:44
* @LastEditTime : 2022-12-12 10:45:24
* @LastEditors : HCLonely
* @FilePath : /auto-task-new/src/scripts/website/Giveawaysu.d.ts
*/
Expand All @@ -17,26 +17,30 @@ declare interface gasSocialTasks {
announcementLinks: Array<string>
workshopVoteLinks: Array<string>
playtestLinks: Array<string>
},
}
discord: {
serverLinks: Array<string>
},
}
instagram: {
userLinks: Array<string>
},
}
vk: {
nameLinks: Array<string>
},
}
twitch: {
channelLinks: Array<string>
},
}
reddit: {
redditLinks: Array<string>
},
}
youtube: {
channelLinks: Array<string>
likeLinks: Array<string>
}
twitter: {
userLinks: Array<string>
retweetLinks: Array<string>
}
}
declare interface gasGMTasks {
tasks: gasSocialTasks
Expand Down
4 changes: 4 additions & 0 deletions src/scripts/website/Giveawaysu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const defaultTasks: gasSocialTasks = {
youtube: {
channelLinks: [],
likeLinks: []
},
twitter: {
userLinks: [],
retweetLinks: []
}
};

Expand Down
11 changes: 9 additions & 2 deletions src/scripts/website/GiveeClub.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author : HCLonely
* @Date : 2021-11-14 11:46:52
* @LastEditTime : 2022-07-15 10:34:43
* @LastEditTime : 2022-12-12 11:01:22
* @LastEditors : HCLonely
* @FilePath : /auto-task-new/src/scripts/website/GiveeClub.ts
* @Description : https://givee.club/
Expand Down Expand Up @@ -75,7 +75,8 @@ class GiveeClub extends GiveawaySu {
const taskName = taskDes.text().trim();
const taskType = $(task).find('button[data-type]')
?.attr('data-type');
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
const taskFinished = $(task).find('.event-action-buttons .btn-success')?.length;
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
return resolve(true);
}

Expand Down Expand Up @@ -116,6 +117,12 @@ class GiveeClub extends GiveawaySu {
this.undoneTasks.youtube.likeLinks.push(taskLink);
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
this.undoneTasks.vk.nameLinks.push(taskLink);
} else if (taskIcon.includes('twitter')) {
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
this.undoneTasks.twitter.userLinks.push(taskLink);
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
this.undoneTasks.twitter.retweetLinks.push(taskLink);
}
} else {
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {
// this.taskInfo.links.push(link)
Expand Down

1 comment on commit 9049949

@vercel
Copy link

@vercel vercel bot commented on 9049949 Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.