您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Does things...
- // ==UserScript==
- // @name HIT Scraper to MTurk Suite
- // @namespace https://github.com/Kadauchi
- // @version 1.0.0
- // @description Does things...
- // @author Kadauchi
- // @icon http://i.imgur.com/oGRQwPN.png
- // @include https://www.mturk.com/hitscraper-to-mturk-suite
- // @include https://worker.mturk.com/hitscraper-to-mturk-suite
- // ==/UserScript==
- (function () {
- const bl = window.localStorage.getItem(`scraper_ignore_list`)
- const il = window.localStorage.getItem(`scraper_include_list`)
- if (bl || il) {
- document.body.innerHTML = ``
- if (bl) {
- const blockList = convertBlockList(bl)
- saveToFileJSON(`block-list`, blockList)
- }
- if (il) {
- const includeList = convertIncludeList(il)
- saveToFileJSON(`include-list`, includeList)
- }
- } else {
- document.body.innerHTML = `No HIT Scraper Block or Include Lists found`
- }
- })()
- function convertBlockList () {
- const [list] = arguments
- const mturkSuite = {}
- const hitScraper = list.split(`^`)
- for (const value of hitScraper) {
- mturkSuite[value] = {
- name: value,
- match: value,
- strict: true
- }
- }
- return mturkSuite
- }
- function convertIncludeList () {
- const [list] = arguments
- const mturkSuite = {}
- const hitScraper = list.split(`^`)
- for (const value of hitScraper) {
- mturkSuite[value] = {
- name: value,
- match: value,
- strict: true,
- sound: true,
- alarm: false,
- pushbullet: false,
- notification: true
- }
- }
- return mturkSuite
- }
- function saveToFileJSON () {
- const [name, json] = arguments
- const today = new Date()
- const month = today.getMonth() + 1
- const day = today.getDate()
- const year = today.getFullYear()
- const date = `${year}${month < 10 ? `0` : ``}${month}${day < 10 ? `0` : ``}${day}`
- const data = JSON.stringify(json)
- const exportFile = document.createElement(`a`)
- exportFile.href = window.URL.createObjectURL(new window.Blob([data], { type: `application/json` }))
- exportFile.download = `scraper-to-mts-backup-${date}-${name}.json`
- exportFile.textContent = `scraper-to-mts-backup-${date}-${name}.json`
- document.body.appendChild(exportFile)
- document.body.appendChild(document.createElement(`br`))
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址