Greasy Fork is available in English.

阿里巴巴商品关键词获取(内测)

自动获取阿里巴巴商品收录关键词并展示在详情页顶部

Versión del día 13/10/2019. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @icon             https://www.thfou.com/img/favicon.png
// @name             阿里巴巴商品关键词获取(内测)
// @namespace        https://www.thfou.com/
// @version          1.0.4
// @description      自动获取阿里巴巴商品收录关键词并展示在详情页顶部
// @author           头号否
// @match            *://detail.1688.com/offer/*
// @require          https://libs.baidu.com/jquery/1.10.2/jquery.min.js
// @supportURL       https://www.thfou.com/liuyan
// @compatible	     Chrome
// @compatible	     Firefox
// @compatible	     Edge
// @compatible   	 Safari
// @compatible   	 Opera
// @compatible	     UC
// @license          GPL-3.0-only
// @grant            none
// @run-at           context-menu
// ==/UserScript==

(function() {
    'use strict';
//获取关键词
var getkeywords = document.createElement('div'); // 新增元素
   getkeywords.className = 'item';
   getkeywords.id = 'offer-keywords';
   var data = document.querySelector('#sell-sku-analyze'); // 获取元素
   var sc = document.getElementsByName("keywords")[0].content;
   var sca = '<p>关键词:</p><span>';
   var scb = '</span>';
   var scc = sc;
   getkeywords.innerHTML = sca + scc + scb;
      data.parentNode.insertBefore(getkeywords, data); // 在这个元素前面增加上去
//获取登录ID
var getloginid = document.createElement('div'); // 新增元素
   getloginid.className = 'item';
   getloginid.id = 'wp-loginid';
   var id = document.querySelector('#offer-cate'); // 获取元素
   var datas = $('.ww-inline').attr('href');
   var url = decodeURI(datas);
   var reg = /.*uid[\s\=]+([^\&]+)\&.*/;
   url = url.replace(reg, "$1");
   var urla = '<p>登录ID:</p><span>';
   var urlb = '</span>';
   getloginid.innerHTML = urla + url + urlb;
      id.parentNode.insertBefore(getloginid, id); // 在这个元素前面增加上去
//插入直播按钮
var addlive = document.createElement('div'); // 新增元素
   addlive.className = 'btn';
   addlive.id = 'wp-live';
   var live = document.querySelector('#sell-sku-analyze'); // 获取元素
   var livea = 'https://cui.m.1688.com/weex/page/7150.html?spm=a261y.7663282.descBanner.1.42a4319e2l7OAw&__positionId__=live&__pageId__=7150&__weex__=true&loginId=';
   var liveb = decodeURI(url);
   var livec = '<a style="color:#fff" target="_blank" href="';
   var lived = '">';
   var livee = '进入直播间';
   var livef = '</a>';
   var liveg = encodeURI(liveb);
   addlive.innerHTML = livee;
      live.parentNode.insertBefore(addlive, live); // 在这个元素前面增加上去
    document.getElementById('wp-live').innerHTML = livec + livea + liveg + lived + livee + livef;
})();