MerchantWords批量复制关键词

添加按钮,一键复制到剪贴板,可选择数量,可设置最大数量,或者复制所有。按行输出

当前为 2017-11-07 提交的版本,查看 最新版本

// ==UserScript==
// @name         MerchantWords批量复制关键词
// @version      0.1
// @description  添加按钮,一键复制到剪贴板,可选择数量,可设置最大数量,或者复制所有。按行输出
// @author       QHS
// @include      http*://www.merchantwords.com/search/*
// @grant        GM_setClipboard
// @grant        GM_addStyle
// @supportURL	 https://gf.qytechs.cn/scripts/34887
// @namespace    https://gf.qytechs.cn/users/155548
// ==/UserScript==

"use strict";

!function() {

    //const default_max_ammount = 120;//这里设置默认最大数量,如不需要请将此行注释掉

    var t = "undefined" != typeof default_max_ammount ? Math.min(default_max_ammount, $(".table .table__content").length) : $(".table .table__content").length;
    GM_addStyle("#ammount input{font-size: 10px; text-align: center; width: 60px;padding-left: 15px; border:1px transparent solid; border-radius: 5px; box-shadow: -1px 2px 3px rgba(0,0,0,0.1);transition:.4s}#ammount input:hover,#ammount input:focus{padding:0;width:75px;border:1px #a9d3e1 solid}.copied{background: #c8f8d0!important; color: #069d35!important; border-color: transparent!important; cursor: not-allowed;}.cannotcopy{background:#ffd3d3!important;border-color:transparent!important;}.cannotcopy:hover{background:#f80c0c!important; cursor: not-allowed;}"),
    $("div.section__head-actions").prepend('<a class="btn btn-white copyto' + (0 == t ? " cannotcopy" : "") + '" href="javascript:;" onclick="copyto()"> <span id="_icon"> <i class="zmdi zmdi-copy"></i> Copy </span></a>'),
    $("div.section__head-actions").append('<br><span id="ammount" style="font-size: 16px;text-align: center;"><input value="' + t + '"type="number"min="' + (0 == t ? 0 : 1) + '"max="' + $(".table .table__content").length + '"><font class=_end> Keywords Total</font></span><span id="ammount2" style="display:none"></span>'),
    $(".btn.btn-white.js-btn-toggle").remove(), $("div.section__head-actions").on("mouseover mouseout", "#ammount input", function(t) {
        "mouseover" == t.type ? $("font._end").html(" To Copy") : "mouseout" == t.type && $("font._end").html(" Keywords Total");
    }), $("div.section__head-actions").on("change", "#ammount input", function() {
        0 == $(this).val() ? $(".copyto").addClass("cannotcopy") : $(".copyto").removeClass("cannotcopy");
    }), $("div.section__head-actions").on("click", ".copyto", function() {
        var t = $("#ammount input").val();
        if (0 == t) return !1;
        var o = "";
        $(".table .table__content").each(function(n) {
            if (!(n < t)) return !1;
            o += $(".table .table__content")[n].textContent.replace(" Search MerchantWordsSearch Amazon", "\n");
        }), GM_setClipboard(o), $("#ammount").slideUp(300), $("#ammount2").html(Math.min(t, $(".table .table__content").length) + " Keywords Copied To Clipboard!"),
        $("#ammount2").delay(500).slideDown(300), $(".zmdi-copy").removeClass("zmdi-copy").addClass("zmdi-check-all"),
        $(".copyto").removeClass("copyto").addClass("copied"), $("#_icon").html(' <i class="zmdi zmdi-check-all"></i> Copied </span>');
    });
}();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址