Skip to content

Commit

Permalink
1. 油管、推特验证机制优化;
Browse files Browse the repository at this point in the history
2. 白名单、任务历史、数据同步功能移动到设置页面;
3. 其他优化
  • Loading branch information
HCLonely committed Jan 8, 2022
1 parent 9f8af6c commit 418ebe2
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 87 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
"cSpell.words": [
"hclonely",
"keyboardjs",
"OSSAR",
"topbottpm",
"uglifyjs",
"unretweet",
"vloot",
"xuanmo"
]
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

33 changes: 15 additions & 18 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.1.7-Beta
// @version 4.1.8-Beta
// @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 @@ -1193,8 +1193,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
globalOptions: '全局设置',
checkLogin: '登录检测</br>需要登录的网站自动登录,部分本网站支持',
checkLeftKey: '剩余Key检测</br>赠Key活动结束提示是否关闭,部分本网站支持',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214</br>不想关注官方账号可以改为自己的帐号',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q</br>不想关注官方频道可以改为自己的频道',
autoUpdateSource: '更新源</br>github: 需代理,实时更新</br>jsdelivr: 可不用代理,更新有延迟</br>standby: 备用</br>auto: 依次使用github, jsdelivr, standby源进行尝试更新',
saveGlobalOptions: '保存全局设置',
settingPage: '设置页面',
Expand Down Expand Up @@ -1429,8 +1429,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
globalOptions: 'Global Options',
checkLogin: 'Login detection</br>Need to log in to the website automatically log in, part of this website supports.',
checkLeftKey: 'Key remaining detection</br>The end of the giveaway event prompts whether to close or not, part of this website supports.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.',
youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.</br>' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.</br>' + 'If you don\'t want to follow the official account, you can change it to your own account.',
youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.</br>' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.</br>' + 'If you don\'t want to follow the official channel, you can change it to your own channel.',
autoUpdateSource: 'The source to update</br>github: Fast update.</br>jsdelivr: Update is delayed.</br>' + 'standby: Standby source.</br>auto: Try to update using github, jsdelivr, standby sources in turn.',
saveGlobalOptions: 'SaveSettings',
settingPage: 'Setting Page',
Expand Down Expand Up @@ -1564,8 +1564,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
retweets: 'Retweet',
followingTwitterUser: 'Following Twitter User',
unfollowingTwitterUser: 'Unfollowing Twitter User',
retweetting: 'Retweeting',
unretweetting: 'Unretweeting',
retweetting: 'Retweetting',
unretweetting: 'Unretweetting',
names: 'Group/Public/Wall',
loginVk: 'Please <a href="https://vk.com/login/" target="_blank">log in to Vk</a>',
gettingVkId: 'Getting Vk task Id',
Expand Down Expand Up @@ -4459,6 +4459,10 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
}
return true;
}
if (verify && data.responseText.includes('You may not subscribe to yourself')) {
logStatus.success();
return true;
}
logStatus.error(i18n('tryUpdateYtbAuth'), true);
return false;
}
Expand Down Expand Up @@ -5540,7 +5544,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
if (!doTask && this.whiteList.forums.includes(gameId)) {
scripts_echoLog({
type: 'whiteList',
text: 'Steam.unsubscribForum',
text: 'Steam.unsubscribeForum',
id: gameId
});
return true;
Expand Down Expand Up @@ -8130,8 +8134,8 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
}
after() {
try {
const selecter = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container';
const mainPost = $(selecter);
const selector = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container';
const mainPost = $(selector);
const discordLinks = mainPost.find('a[href*="discord.com"]');
const redditLinks = mainPost.find('a[href*="reddit.com"]');
const insLinks = mainPost.find('a[href*="instagram.com"]');
Expand Down Expand Up @@ -9597,7 +9601,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
Setting_classPrivateMethodInitSpec(this, Setting_getId);
Setting_defineProperty(this, 'name', 'Setting');
Setting_defineProperty(this, 'buttons', [ 'saveGlobalOptions', 'syncData', 'tasksHistory' ]);
Setting_defineProperty(this, 'dataSync', dataSync);
Setting_defineProperty(this, 'syncData', dataSync);
}
tasksHistory() {
window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
Expand Down Expand Up @@ -10181,16 +10185,9 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
});
}
if (website.name !== 'Setting') {
GM_registerMenuCommand(i18n('whiteList'), () => {
whiteList('swal');
});
GM_registerMenuCommand(i18n('changeGlobalOptions'), () => {
changeGlobalOptions('swal');
});
GM_registerMenuCommand(i18n('tasksHistory'), () => {
window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
});
GM_registerMenuCommand(i18n('syncData'), dataSync);
GM_registerMenuCommand(i18n('settingPage'), () => {
window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank');
});
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "auto-task-new",
"version": "4.1.7-Beta",
"version": "4.1.8-Beta",
"change": [
"Gleam任务识别优化,自动填写表单优化"
"油管、推特验证机制优化",
"白名单、任务历史、数据同步功能移动到设置页面",
"其他优化"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
"scripts": {
"test": "eslint",
"tsc": "tsc",
"gs": "webpack --config webpack.giveawaysu.config.js",
"pack": "webpack --config webpack.config.js",
"dev": "webpack --config webpack.config.js",
"build": "webpack --config webpack.config.js && webpack --config webpack.compatibility.config.js && webpack --config webpack.giveawaysu.config.js && node copy.js"
},
"author": "HCLonely <h1606051253@gmail.com>",
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

33 changes: 15 additions & 18 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.1.7-Beta
// @version 4.1.8-Beta
// @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 @@ -1193,8 +1193,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
globalOptions: '全局设置',
checkLogin: '登录检测</br>需要登录的网站自动登录,部分本网站支持',
checkLeftKey: '剩余Key检测</br>赠Key活动结束提示是否关闭,部分本网站支持',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214</br>不想关注官方账号可以改为自己的帐号',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q</br>不想关注官方频道可以改为自己的频道',
autoUpdateSource: '更新源</br>github: 需代理,实时更新</br>jsdelivr: 可不用代理,更新有延迟</br>standby: 备用</br>auto: 依次使用github, jsdelivr, standby源进行尝试更新',
saveGlobalOptions: '保存全局设置',
settingPage: '设置页面',
Expand Down Expand Up @@ -1429,8 +1429,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
globalOptions: 'Global Options',
checkLogin: 'Login detection</br>Need to log in to the website automatically log in, part of this website supports.',
checkLeftKey: 'Key remaining detection</br>The end of the giveaway event prompts whether to close or not, part of this website supports.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.',
youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.</br>' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.</br>' + 'If you don\'t want to follow the official account, you can change it to your own account.',
youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.</br>' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.</br>' + 'If you don\'t want to follow the official channel, you can change it to your own channel.',
autoUpdateSource: 'The source to update</br>github: Fast update.</br>jsdelivr: Update is delayed.</br>' + 'standby: Standby source.</br>auto: Try to update using github, jsdelivr, standby sources in turn.',
saveGlobalOptions: 'SaveSettings',
settingPage: 'Setting Page',
Expand Down Expand Up @@ -1564,8 +1564,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载');
retweets: 'Retweet',
followingTwitterUser: 'Following Twitter User',
unfollowingTwitterUser: 'Unfollowing Twitter User',
retweetting: 'Retweeting',
unretweetting: 'Unretweeting',
retweetting: 'Retweetting',
unretweetting: 'Unretweetting',
names: 'Group/Public/Wall',
loginVk: 'Please <a href="https://vk.com/login/" target="_blank">log in to Vk</a>',
gettingVkId: 'Getting Vk task Id',
Expand Down Expand Up @@ -4459,6 +4459,10 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
}
return true;
}
if (verify && data.responseText.includes('You may not subscribe to yourself')) {
logStatus.success();
return true;
}
logStatus.error(i18n('tryUpdateYtbAuth'), true);
return false;
}
Expand Down Expand Up @@ -5540,7 +5544,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
if (!doTask && this.whiteList.forums.includes(gameId)) {
scripts_echoLog({
type: 'whiteList',
text: 'Steam.unsubscribForum',
text: 'Steam.unsubscribeForum',
id: gameId
});
return true;
Expand Down Expand Up @@ -8130,8 +8134,8 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
}
after() {
try {
const selecter = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container';
const mainPost = $(selecter);
const selector = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container';
const mainPost = $(selector);
const discordLinks = mainPost.find('a[href*="discord.com"]');
const redditLinks = mainPost.find('a[href*="reddit.com"]');
const insLinks = mainPost.find('a[href*="instagram.com"]');
Expand Down Expand Up @@ -9597,7 +9601,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
Setting_classPrivateMethodInitSpec(this, Setting_getId);
Setting_defineProperty(this, 'name', 'Setting');
Setting_defineProperty(this, 'buttons', [ 'saveGlobalOptions', 'syncData', 'tasksHistory' ]);
Setting_defineProperty(this, 'dataSync', dataSync);
Setting_defineProperty(this, 'syncData', dataSync);
}
tasksHistory() {
window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
Expand Down Expand Up @@ -10181,16 +10185,9 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\
});
}
if (website.name !== 'Setting') {
GM_registerMenuCommand(i18n('whiteList'), () => {
whiteList('swal');
});
GM_registerMenuCommand(i18n('changeGlobalOptions'), () => {
changeGlobalOptions('swal');
});
GM_registerMenuCommand(i18n('tasksHistory'), () => {
window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
});
GM_registerMenuCommand(i18n('syncData'), dataSync);
GM_registerMenuCommand(i18n('settingPage'), () => {
window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank');
});
Expand Down
10 changes: 6 additions & 4 deletions page/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "auto-task-new",
"version": "4.1.7-Beta",
"version": "4.1.8-Beta",
"change": [
"Gleam任务识别优化,自动填写表单优化"
"油管、推特验证机制优化",
"白名单、任务历史、数据同步功能移动到设置页面",
"其他优化"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
"scripts": {
"test": "eslint",
"tsc": "tsc",
"gs": "webpack --config webpack.giveawaysu.config.js",
"pack": "webpack --config webpack.config.js",
"dev": "webpack --config webpack.config.js",
"build": "webpack --config webpack.config.js && webpack --config webpack.compatibility.config.js && webpack --config webpack.giveawaysu.config.js && node copy.js"
},
"author": "HCLonely",
"author": "HCLonely <h1606051253@gmail.com>",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.16.0",
Expand Down
14 changes: 6 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author : HCLonely
* @Date : 2021-10-26 15:44:54
* @LastEditTime : 2022-01-06 13:35:09
* @LastEditTime : 2022-01-08 17:19:28
* @LastEditors : HCLonely
* @FilePath : /auto-task-new/src/index.ts
* @Description :
Expand Down Expand Up @@ -128,7 +128,6 @@ const loadScript = async () => {
});
keyboardJS.bind(globalOptions.hotKey.toggleLogKey, toggleLog);

// do something
// @ts-ignore
if (website?.after) await website?.after();

Expand All @@ -141,7 +140,6 @@ const loadScript = async () => {
// @ts-ignore
if (website[button]) {
// @ts-ignore
// GM_registerMenuCommand(__(button), () => { website[button](); });
const btnElement =
$(`<p><a class="auto-task-website-btn ${website.name}-button" href="javascript:void(0);" target="_self">${__(button)}</a></p>`);
// @ts-ignore
Expand Down Expand Up @@ -173,12 +171,12 @@ const loadScript = async () => {
}

if (website.name !== 'Setting') {
GM_registerMenuCommand(__('whiteList'), () => { whiteListOptions('swal'); });
// GM_registerMenuCommand(__('whiteList'), () => { whiteListOptions('swal'); });
GM_registerMenuCommand(__('changeGlobalOptions'), () => { changeGlobalOptions('swal'); });
GM_registerMenuCommand(__('tasksHistory'), () => {
window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
});
GM_registerMenuCommand(__('syncData'), syncOptions);
// GM_registerMenuCommand(__('tasksHistory'), () => {
// window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');
// });
// GM_registerMenuCommand(__('syncData'), syncOptions);
GM_registerMenuCommand(__('settingPage'), () => {
window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank');
});
Expand Down
12 changes: 7 additions & 5 deletions src/locales/en-US.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author : HCLonely
* @Date : 2021-12-30 17:08:27
* @LastEditTime : 2022-01-07 10:09:45
* @LastEditTime : 2022-01-08 17:03:59
* @LastEditors : HCLonely
* @FilePath : /auto-task-new/src/locales/en-US.js
* @Description : i18n英文
Expand Down Expand Up @@ -76,9 +76,11 @@ const data = {
globalOptions: 'Global Options',
checkLogin: 'Login detection</br>Need to log in to the website automatically log in, part of this website supports.',
checkLeftKey: 'Key remaining detection</br>The end of the giveaway event prompts whether to close or not, part of this website supports.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.',
twitterVerifyId: 'Verify Twitter token by trying to follow the account.</br>The default is the official Twitter account 783214.</br>' +
'If you don\'t want to follow the official account, you can change it to your own account.',
youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.</br>' +
'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.',
'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.</br>' +
'If you don\'t want to follow the official channel, you can change it to your own channel.',
autoUpdateSource: 'The source to update</br>github: Fast update.</br>jsdelivr: Update is delayed.</br>' +
'standby: Standby source.</br>auto: Try to update using github, jsdelivr, standby sources in turn.',
saveGlobalOptions: 'SaveSettings',
Expand Down Expand Up @@ -236,8 +238,8 @@ const data = {
retweets: 'Retweet',
followingTwitterUser: 'Following Twitter User',
unfollowingTwitterUser: 'Unfollowing Twitter User',
retweetting: 'Retweeting',
unretweetting: 'Unretweeting',
retweetting: 'Retweetting',
unretweetting: 'Unretweetting',

// Vk
names: 'Group/Public/Wall',
Expand Down
4 changes: 2 additions & 2 deletions src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const data = {
globalOptions: '全局设置',
checkLogin: '登录检测</br>需要登录的网站自动登录,部分本网站支持',
checkLeftKey: '剩余Key检测</br>赠Key活动结束提示是否关闭,部分本网站支持',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q',
twitterVerifyId: '通过尝试关注该账号验证Twitter凭证</br>默认为Twitter官方帐号 783214</br>不想关注官方账号可以改为自己的帐号',
youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证</br>默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q</br>不想关注官方频道可以改为自己的频道',
autoUpdateSource: '更新源</br>github: 需代理,实时更新</br>jsdelivr: 可不用代理,更新有延迟</br>standby: 备用</br>auto: 依次使用github, jsdelivr, standby源进行尝试更新',
saveGlobalOptions: '保存全局设置',
settingPage: '设置页面',
Expand Down
Loading

1 comment on commit 418ebe2

@vercel
Copy link

@vercel vercel bot commented on 418ebe2 Jan 8, 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.