淘口令解析

将淘宝生成的淘口令转换为链接

Versión del día 16/09/2020. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name            淘口令解析
// @name:en         Taobao Command Parse
// @namespace       net.coolkk.taobaocommandparse
// @description     将淘宝生成的淘口令转换为链接
// @description:en  Taobao Command Parse conversion into the link
// @version         1.0.0
// @author          Coolkk
// @icon            https://img.alicdn.com/tps/i3/T1OjaVFl4dXXa.JOZB-114-114.png
// @homepage        https://github.com/Coolkkmeat/TaobaoCommandParse
// @supportURL      https://github.com/Coolkkmeat/TaobaoCommandParse/issues
// @contributionURL https://coolkk.net/
// @license         Apache License 2.0
// @charset		    UTF-8
// @require         https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @include         http*://*taobao.com/*
// @grant           GM_xmlhttpRequest
// @connect         taofake.com
// @run-at          document-idle
// ==/UserScript==

(function () {
    "use strict";
    $("#q").on("input propertychange", function () {
        var code = $("#q").val().match(/(¥|\$)([a-zA-Z0-9]*)(¥|\$)/)[2];
        if (code) {
            GM_xmlhttpRequest({
                url: "//www.taofake.com/index/tools/gettkljm.html?tkl=" + code,
                method: "GET",
                responseType: "json",
                timeout: 10000,
                onload: function (res) {
                    res = JSON.parse(res.responseText);
                    if (res.code == 1) {
                        $(window).attr("location", res.data.url);
                    }
                }
            });
        }
    });
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。