Skip to content

Commit 9049949

Browse files
committed
新增:Twitter任务识别[GiveeClub]
1 parent fc31349 commit 9049949

20 files changed

+168
-102
lines changed

.github/workflows/Release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ jobs:
2121
uses: softprops/action-gh-release@v1
2222
with:
2323
prerelease: false
24-
tag_name: v4.2.23
25-
name: 4.2.23
26-
body: |-
27-
- Keyhub反屏蔽ADB
28-
- Keyhub任务识别优化
24+
tag_name: v4.2.24
25+
name: 4.2.24
26+
body: '- GiveeClub新增Twitter任务识别'
2927
files: |-
3028
dist/auto-task-v4-for-giveawaysu.user.js
3129
dist/auto-task-v4.compatibility.user.js

dist/auto-task-v4-for-giveawaysu.all.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4-for-giveawaysu.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.all.user.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task-v4
33
// @namespace auto-task-v4
4-
// @version 4.2.23
4+
// @version 4.2.24
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -7393,6 +7393,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
73937393
youtube: {
73947394
channelLinks: [],
73957395
likeLinks: []
7396+
},
7397+
twitter: {
7398+
userLinks: [],
7399+
retweetLinks: []
73967400
}
73977401
};
73987402
var _checkLogin = new WeakSet();
@@ -8640,12 +8644,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86408644
const tasks = $('.event-actions tr');
86418645
for (const task of tasks) {
86428646
pro.push(new Promise(resolve => {
8643-
var _$$find;
8647+
var _$$find, _$$find2;
86448648
const taskDes = $(task).find('.event-action-label a');
86458649
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
86468650
const taskName = taskDes.text().trim();
86478651
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
8648-
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
8652+
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
8653+
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
86498654
return resolve(true);
86508655
}
86518656
getRedirectLink(taskDes.attr('href')).then(taskLink => {
@@ -8684,6 +8689,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86848689
this.undoneTasks.youtube.likeLinks.push(taskLink);
86858690
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
86868691
this.undoneTasks.vk.nameLinks.push(taskLink);
8692+
} else if (taskIcon.includes('twitter')) {
8693+
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
8694+
this.undoneTasks.twitter.userLinks.push(taskLink);
8695+
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
8696+
this.undoneTasks.twitter.retweetLinks.push(taskLink);
8697+
}
86878698
} else {
86888699
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
86898700
if (/follow.*button/gim.test(taskName)) {

dist/auto-task-v4.compatibility.all.user.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.compatibility.user.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auto-task-v4.user.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task-v4
33
// @namespace auto-task-v4
4-
// @version 4.2.23
4+
// @version 4.2.24
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -7374,6 +7374,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
73747374
youtube: {
73757375
channelLinks: [],
73767376
likeLinks: []
7377+
},
7378+
twitter: {
7379+
userLinks: [],
7380+
retweetLinks: []
73777381
}
73787382
};
73797383
var _checkLogin = new WeakSet();
@@ -8621,12 +8625,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86218625
const tasks = $('.event-actions tr');
86228626
for (const task of tasks) {
86238627
pro.push(new Promise(resolve => {
8624-
var _$$find;
8628+
var _$$find, _$$find2;
86258629
const taskDes = $(task).find('.event-action-label a');
86268630
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
86278631
const taskName = taskDes.text().trim();
86288632
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
8629-
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
8633+
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
8634+
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
86308635
return resolve(true);
86318636
}
86328637
getRedirectLink(taskDes.attr('href')).then(taskLink => {
@@ -8665,6 +8670,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86658670
this.undoneTasks.youtube.likeLinks.push(taskLink);
86668671
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
86678672
this.undoneTasks.vk.nameLinks.push(taskLink);
8673+
} else if (taskIcon.includes('twitter')) {
8674+
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
8675+
this.undoneTasks.twitter.userLinks.push(taskLink);
8676+
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
8677+
this.undoneTasks.twitter.retweetLinks.push(taskLink);
8678+
}
86688679
} else {
86698680
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
86708681
if (/follow.*button/gim.test(taskName)) {

doc/docs/logs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ lang: zh-CN
55

66
## V4.2
77

8+
### V4.2.24
9+
10+
[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.2.24)
11+
12+
- GiveeClub新增Twitter任务识别
13+
814
### V4.2.23
915

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "auto-task-v4",
3-
"version": "4.2.23",
3+
"version": "4.2.24",
44
"change": [
5-
"Keyhub反屏蔽ADB",
6-
"Keyhub任务识别优化"
5+
"新增:Twitter任务识别[GiveeClub]",
6+
"优化"
77
],
88
"description": "赠Key站自动任务脚本",
99
"main": "package.json",

page/dist/auto-task-v4-for-giveawaysu.all.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page/dist/auto-task-v4-for-giveawaysu.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page/dist/auto-task-v4.all.user.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task-v4
33
// @namespace auto-task-v4
4-
// @version 4.2.23
4+
// @version 4.2.24
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -7393,6 +7393,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
73937393
youtube: {
73947394
channelLinks: [],
73957395
likeLinks: []
7396+
},
7397+
twitter: {
7398+
userLinks: [],
7399+
retweetLinks: []
73967400
}
73977401
};
73987402
var _checkLogin = new WeakSet();
@@ -8640,12 +8644,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86408644
const tasks = $('.event-actions tr');
86418645
for (const task of tasks) {
86428646
pro.push(new Promise(resolve => {
8643-
var _$$find;
8647+
var _$$find, _$$find2;
86448648
const taskDes = $(task).find('.event-action-label a');
86458649
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
86468650
const taskName = taskDes.text().trim();
86478651
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
8648-
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
8652+
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
8653+
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
86498654
return resolve(true);
86508655
}
86518656
getRedirectLink(taskDes.attr('href')).then(taskLink => {
@@ -8684,6 +8689,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86848689
this.undoneTasks.youtube.likeLinks.push(taskLink);
86858690
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
86868691
this.undoneTasks.vk.nameLinks.push(taskLink);
8692+
} else if (taskIcon.includes('twitter')) {
8693+
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
8694+
this.undoneTasks.twitter.userLinks.push(taskLink);
8695+
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
8696+
this.undoneTasks.twitter.retweetLinks.push(taskLink);
8697+
}
86878698
} else {
86888699
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
86898700
if (/follow.*button/gim.test(taskName)) {

page/dist/auto-task-v4.compatibility.all.user.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page/dist/auto-task-v4.compatibility.user.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page/dist/auto-task-v4.user.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name auto-task-v4
33
// @namespace auto-task-v4
4-
// @version 4.2.23
4+
// @version 4.2.24
55
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
66
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
77
// @author HCLonely
@@ -7374,6 +7374,10 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
73747374
youtube: {
73757375
channelLinks: [],
73767376
likeLinks: []
7377+
},
7378+
twitter: {
7379+
userLinks: [],
7380+
retweetLinks: []
73777381
}
73787382
};
73797383
var _checkLogin = new WeakSet();
@@ -8621,12 +8625,13 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86218625
const tasks = $('.event-actions tr');
86228626
for (const task of tasks) {
86238627
pro.push(new Promise(resolve => {
8624-
var _$$find;
8628+
var _$$find, _$$find2;
86258629
const taskDes = $(task).find('.event-action-label a');
86268630
const taskIcon = $(task).find('.event-action-icon i').attr('class') || '';
86278631
const taskName = taskDes.text().trim();
86288632
const taskType = (_$$find = $(task).find('button[data-type]')) === null || _$$find === void 0 ? void 0 : _$$find.attr('data-type');
8629-
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope')) {
8633+
const taskFinished = (_$$find2 = $(task).find('.event-action-buttons .btn-success')) === null || _$$find2 === void 0 ? void 0 : _$$find2.length;
8634+
if (taskIcon.includes('ban') || /AdBlock/i.test(taskName) || taskIcon.includes('envelope') || taskFinished) {
86308635
return resolve(true);
86318636
}
86328637
getRedirectLink(taskDes.attr('href')).then(taskLink => {
@@ -8665,6 +8670,12 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
86658670
this.undoneTasks.youtube.likeLinks.push(taskLink);
86668671
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
86678672
this.undoneTasks.vk.nameLinks.push(taskLink);
8673+
} else if (taskIcon.includes('twitter')) {
8674+
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
8675+
this.undoneTasks.twitter.userLinks.push(taskLink);
8676+
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
8677+
this.undoneTasks.twitter.retweetLinks.push(taskLink);
8678+
}
86688679
} else {
86698680
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {} else {
86708681
if (/follow.*button/gim.test(taskName)) {

page/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"name": "auto-task-v4",
3-
"version": "4.2.23",
3+
"version": "4.2.24",
44
"change": [
5-
"Keyhub反屏蔽ADB",
6-
"Keyhub任务识别优化"
5+
"GiveeClub新增Twitter任务识别"
76
],
87
"description": "赠Key站自动任务脚本",
98
"main": "package.json",

src/for_giveawaysu/Giveawaysu.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
* @Author : HCLonely
33
* @Date : 2021-11-08 10:37:13
4-
* @LastEditTime : 2022-05-18 10:00:20
4+
* @LastEditTime : 2022-12-12 10:54:24
55
* @LastEditors : HCLonely
66
* @FilePath : /auto-task-new/src/for_giveawaysu/Giveawaysu.ts
77
* @Description : https://giveaway.su/
88
*/
99

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

1313
import Swal from 'sweetalert2';
1414
import throwError from '../scripts/tools/throwError';
@@ -55,6 +55,10 @@ const defaultTasks: gasSocialTasks = {
5555
youtube: {
5656
channelLinks: [],
5757
likeLinks: []
58+
},
59+
twitter: {
60+
userLinks: [],
61+
retweetLinks: []
5862
}
5963
};
6064

src/scripts/website/Giveawaysu.d.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @Author : HCLonely
33
* @Date : 2021-11-08 10:43:23
4-
* @LastEditTime : 2022-01-20 10:39:44
4+
* @LastEditTime : 2022-12-12 10:45:24
55
* @LastEditors : HCLonely
66
* @FilePath : /auto-task-new/src/scripts/website/Giveawaysu.d.ts
77
*/
@@ -17,26 +17,30 @@ declare interface gasSocialTasks {
1717
announcementLinks: Array<string>
1818
workshopVoteLinks: Array<string>
1919
playtestLinks: Array<string>
20-
},
20+
}
2121
discord: {
2222
serverLinks: Array<string>
23-
},
23+
}
2424
instagram: {
2525
userLinks: Array<string>
26-
},
26+
}
2727
vk: {
2828
nameLinks: Array<string>
29-
},
29+
}
3030
twitch: {
3131
channelLinks: Array<string>
32-
},
32+
}
3333
reddit: {
3434
redditLinks: Array<string>
35-
},
35+
}
3636
youtube: {
3737
channelLinks: Array<string>
3838
likeLinks: Array<string>
3939
}
40+
twitter: {
41+
userLinks: Array<string>
42+
retweetLinks: Array<string>
43+
}
4044
}
4145
declare interface gasGMTasks {
4246
tasks: gasSocialTasks

src/scripts/website/Giveawaysu.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const defaultTasks: gasSocialTasks = {
4848
youtube: {
4949
channelLinks: [],
5050
likeLinks: []
51+
},
52+
twitter: {
53+
userLinks: [],
54+
retweetLinks: []
5155
}
5256
};
5357

src/scripts/website/GiveeClub.ts

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

@@ -116,6 +117,12 @@ class GiveeClub extends GiveawaySu {
116117
this.undoneTasks.youtube.likeLinks.push(taskLink);
117118
} else if (taskIcon.includes('vk') || /join.*vk.*group/gim.test(taskName)) {
118119
this.undoneTasks.vk.nameLinks.push(taskLink);
120+
} else if (taskIcon.includes('twitter')) {
121+
if (/https?:\/\/twitter\.com\/[^/]+\/?$/gim.test(taskLink)) {
122+
this.undoneTasks.twitter.userLinks.push(taskLink);
123+
} else if (/https?:\/\/twitter\.com\/[^/]+?\/status\/[\d]+/gim.test(taskLink)) {
124+
this.undoneTasks.twitter.retweetLinks.push(taskLink);
125+
}
119126
} else {
120127
if (/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)) {
121128
// this.taskInfo.links.push(link)

0 commit comments

Comments
 (0)