快速复制投放数据
// ==UserScript==
// @name 快速复制投放数据
// @namespace http://tampermonkey.net/
// @version 0.16
// @description try to take over the world!
// @author You
// @match https://one.alimama.com/index.html**
// @icon https://www.google.com/s2/favicons?sz=64&domain=superboss.cc
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_listValues
// @grant GM.setClipboard
// ==/UserScript==
let Container = document.createElement('div');
Container.id = "sp-ac-container1";
Container.style.position = "fixed"
Container.style.left = "800px"
Container.style.top = "10px"
Container.style['z-index'] = "999999"
Container.style.border = "2px";
Container.style.border = "solid #a1a1a1";
Container.style.padding = "10px 40px";
Container.style.background = "#FFFFFF";
Container.style.width = "320px";
Container.style.borderRadius = "20px";
Container.innerHTML =`<input type="button" value="直通车复制" id="kaishiztc">--<input type="button" value="引力魔方复制" id="kaishiylmf">--<input type="button" value="万象台复制" id="kaishiwxt">--<input type="button" value="全站复制" id="kaishiqz">`
if(document.location.href.indexOf("one.alimama.com") !== -1){
console.log("已开启功能")
document.body.appendChild(Container);
//万象台按钮
kaishiwxt.onclick=function(){
let 汇总 = ""
let 视频数量 = document.querySelector("#universalBP_common_layout").children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].childElementCount
if(视频数量>80){视频数量=视频数量-1}
for(let i=0;i<视频数量;i++){
console.log(i)
let spmc = document.querySelector("#universalBP_common_layout").children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[2].children[0].children[0].children[0].children[0].children[0].value
let sphf = document.querySelector("#universalBP_common_layout").children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[10].outerText
GM_setValue("视频名称",spmc)
GM_setValue("视频花费",sphf)
汇总 = 汇总+GM_getValue("视频名称") +" "+ GM_getValue("视频花费")+"\n"
GM.setClipboard(汇总)
i=i+1
if(i==(视频数量-1)){
window.alert("复制完成")
}else if(视频数量==80){
if(i==(视频数量-2)){
window.alert("复制完成")
}
}
}
}
//直通车按钮
kaishiztc.onclick=function(){
let 汇总 = ""
let 投放数量 = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].childElementCount
投放数量 = 投放数量-1
for(let i=0;i<投放数量;i++){
console.log(i)
let mc = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[2].children[0].children[0].value
let hf = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[5].outerText
GM_setValue("名称",mc)
GM_setValue("花费",hf)
汇总 = 汇总+GM_getValue("名称") +" "+ GM_getValue("花费")+"\n"
GM.setClipboard(汇总)
i=i+1
if(i==投放数量-1){
window.alert("复制完成")
}
}
}
//引力魔方按钮
kaishiylmf.onclick=function(){
let 汇总 = ""
let 投放数量 = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].childElementCount
投放数量 = 投放数量-1
for(let i=0;i<投放数量;i++){
console.log(i)
let mc = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[2].children[0].children[0].children[1].children[1].text
let hf = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[3].children[1].children[0].children[1].children[i].children[4].innerText
GM_setValue("名称",mc)
GM_setValue("花费",hf)
汇总 = 汇总+GM_getValue("名称") +" "+ GM_getValue("花费")+"\n"
GM.setClipboard(汇总)
i=i+1
if(i==投放数量-1){
window.alert("复制成功")
console.log("复制成功")
}
}
}
//全站推广按钮
kaishiqz.onclick=function(){
let 汇总 = ""
let 投放数量 = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[2].children[1].children[0].children[1].childElementCount
投放数量 = 投放数量-1
for(let i=0;i<投放数量;i++){
console.log(i)
let mc = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[2].children[1].children[0].children[1].children[i].children[2].children[0].children[0].children[1].children[1].text
let hf = document.querySelector("#app").children[2].children[1].children[1].children[0].children[6].children[1].children[2].children[1].children[0].children[1].children[i].children[4].innerText
GM_setValue("名称",mc)
GM_setValue("花费",hf)
汇总 = 汇总+GM_getValue("名称") +" "+ GM_getValue("花费")+"\n"
GM.setClipboard(汇总)
i=i+1
if(i==投放数量-1){
window.alert("复制成功")
console.log("复制成功")
}
}
}
}