// ==UserScript==
// @name 寒假教师研修秒过
// @namespace http://github.com/suifeng/yixing
// @version 1.0.4
// @author ymatou
// @contributionURL https://pic4.zhimg.com/80/v2-b331d70d7350c887d39a8fd78a85de3f_720w.jpg
// @description 寒假研修秒过|寒假教师研修|国家智慧教育公共服务平台|国家中小学智慧教育平台秒过
// @include https://www.ymatou.hk/*
// @include https://www.ymatou.com/*
// @match https://www.smartedu.cn/*
// @match https://basic.smartedu.cn/*
// @match https://smartedu.gdtextbook.com/education/*
// @require https://fastly.jsdelivr.net/npm/sweetalert2@11.12.4/dist/sweetalert2.all.min.js
// @resource css https://fastly.jsdelivr.net/npm/sweetalert2@11.12.4/dist/sweetalert2.min.css
// @match *://wenku.baidu.com/view/*
// @match *://wenku.baidu.com/share/*
// @match *://wenku.baidu.com/link*
// @match *://wenku.baidu.com/aggs/*
// @match *://wenku.baidu.com/ndPureView/*
// @match *://www.51test.net/show/*
// @match *://www.zhihu.com/*
// @match https://*/*
// @run-at document-start
// @run-at window-load
// @connect static.doc88.com
// @license GPL License
// @require https://lib.baomitu.com/jquery/1.8.3/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
// @connect static.doc88.com
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var style = document.createElement('link');
style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
style.rel = 'stylesheet';
style.type = 'text/css';
document.getElementsByTagName('head').item(0).appendChild(style);
var obj = {};
obj.isDetailPageTaoBao = function (url) {
if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf(".jd.") > 0 || url.indexOf("detail.vip") > 0) {
return false;
} else {
return true;
}
};
if(obj.isDetailPageTaoBao(location.href))
{
(function () {
"use strict";
// Your code here...
// 引入第三方库https://github.com/sweetalert2/sweetalert2/
GM_addStyle(GM_getResourceText("css"));
// 弹窗函数
function msg(txt, ms = 3000) {
Swal.fire({
html: txt,
position: "center",
icon: "success",
showConfirmButton: false,
timer: ms,
timerProgressBar: true,
});
}
var log = console.log;
// 课程
var course_name = "2025年寒假教师研修";
var home = "https://basic.smartedu.cn/training/2025hjpx";
var course_url = [
// 学习贯彻全国教育大会精神
"https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=2c5f7bc2-699a-4433-b650-b5e554ed15e3&tag=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE",
// 深化教育综合改革
"https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=4b35be2e-b78c-474b-9e27-85a0bb5757bf&tag=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE",
// 推进教育国际交流合作
"https://basic.smartedu.cn/teacherTraining/courseDetail?courseId=5a72caa9-d09e-4af1-be30-7d970c125038&tag=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE&channelId=&libraryId=bb042e69-9a11-49a1-af22-0c3fab2e92b9&breadcrumb=2025%E5%B9%B4%E5%AF%92%E5%81%87%E6%95%99%E5%B8%88%E7%A0%94%E4%BF%AE",
];
// 上述配置的课程,分别学习多少课时(看多少个视频),因为认定学时有限,每个课程不用刷完!!!
// 配置-1为学完当前课程的所有视频
var lessons = [9, 6, 4];
function next() {
var href = window.location.href;
var index = course_url.indexOf(href);
if (index > -1) {
if (index + 1 < course_url.length) {
window.location.href = course_url[index + 1];
} else {
window.location.href = home;
}
} else {
window.location.href = course_url[0];
}
}
function click(auto_next = true) {
// 判读是否满足学时要求
if (lessons) {
var href = window.location.href;
var index = course_url.indexOf(href);
var lesson = lessons[index];
if (lesson != undefined && lesson != -1) {
let headers = document.getElementsByClassName("fish-collapse-header");
for (let i = 0; i < headers.length; i++) {
let header = headers[i];
header.click();
}
let finish = document.getElementsByClassName(
"iconfont icon_checkbox_fill"
);
log(
`当前页面已经学完【${
finish.length
}】个视频,学时要求为【${lesson}】个视频,是否达标:${
finish.length >= lesson
}`
);
if (finish.length >= lesson) {
next();
}
}
}
var icon = null;
function find_icon() {
// 进行中
icon = document.getElementsByClassName(
"iconfont icon_processing_fill"
)[0];
// 未开始
if (!icon) {
icon = document.getElementsByClassName(
"iconfont icon_checkbox_linear"
)[0];
}
}
// 查找默认列表
find_icon();
// 展开其他列表
if (!icon) {
let headers = document.getElementsByClassName("fish-collapse-header");
for (let i = 0; i < headers.length; i++) {
let header = headers[i];
header.click();
find_icon();
if (icon) {
break;
}
}
}
// 有没学完的
if (icon) {
icon.click();
} else {
if (auto_next) {
next();
} else {
Swal.fire("当前页面所有视频已经播放完!", "", "success");
}
}
}
function play(v = null) {
if (!v) {
v = document.getElementsByTagName("video")[0];
}
if (v) {
//v.dispatchEvent(new Event("ended"));
v.muted = true;
//v.playbackRate = 2;
v.play();
//v.currentTime = v.duration;
}
log(`play: v==>${v}`);
// 关闭提示(必须完整看完整个视频才可以获得该视频的学时。)
let btn = document.getElementsByClassName("fish-btn fish-btn-primary")[0];
if (btn && btn.innerText.includes("知道了")) {
btn.click();
log(`关闭提示: btn==>${btn}`);
}
}
var pageNumber = null;
var pageCount = null;
function read() {
log(`PDF文档阅读: pageNumber==>${pageNumber}, pageCount==>${pageCount}`);
if (pageCount) {
var pc = pageCount;
// 最后一页
log("PDF文档跳到最后一页:", pc);
window.postMessage(
{
type: "pdfPlayerPageChangeing",
data: {
pageNumber: pc,
pageCount: pc,
},
},
"*"
);
// 第一页
setTimeout(function () {
log("PDF文档调到第一页...");
window.postMessage(
{
type: "pdfPlayerPageChangeing",
data: {
pageNumber: 1,
pageCount: pc,
},
},
"*"
);
}, 1000);
// 重置
pageCount = null;
}
}
// 答题
function answer() {
let count = 0;
const intervalId = setInterval(() => {
log("自动答题检测...");
// 选A
var a = document.getElementsByClassName("nqti-check")[0];
if (a) {
a.click();
// 下一题、确定
for (let i = 0; i < 2; i++) {
var btn = document.querySelector(
"div.index-module_footer_3r1Yy > button"
);
if (btn) {
btn.click();
}
}
}
count++;
if (count === 3) {
clearInterval(intervalId);
}
}, 1000);
}
// 广东特色
function gd_class() {
let ms = 10000;
msg("欢迎进入“2024年广东暑期教师研修”专题。", (ms = ms));
let tid = setInterval(function () {
let all_finish = true;
let flags = document.getElementsByClassName("flag");
for (let i = 0; i < flags.length; i++) {
let flag = flags[i];
let display = flag.getElementsByClassName("icon-finish inline-block")[0]
.style.display;
if (display === "none") {
all_finish = false;
let v = document.getElementsByTagName("video")[0];
if (v) {
flag.click();
setTimeout(function () {
v = document.getElementsByTagName("video")[0];
if (v) {
//v.playbackRate = 16;
//v.play();
v.currentTime = v.duration;
}
}, 3000);
}
break;
}
}
if (all_finish) {
clearInterval(tid);
msg("“2024年广东暑期教师研修”专题已学习完毕!", (ms = ms * 10));
} else {
let p =
document.getElementsByClassName("el-progress__text")[0].innerText;
msg(`挂机中,当前进度【${p}】`, (ms = ms));
}
}, ms);
}
function main() {
log("main...");
// 等待页面加载,延时开始
var delay = 1000 * 10;
var href = window.location.href;
if (course_url.includes(href)) {
msg(`等待网页资源加载, 约【${delay / 1000}】秒后开始自动播放视频`, delay);
setInterval(function () {
click();
play();
read();
answer();
}, delay);
} else if (href.includes(`https://smartedu.gdtextbook.com/education/`)) {
log(`“2024年广东暑期教师研修”专题iframe的跨域处理`);
} else {
Swal.fire({
//background: "#url(https://baotangguo.cn:8081/)",
icon: "warning",
title: "开始刷视频?",
//text: "好好学习,天天向上!",
/*
html: ``,
willOpen: () => {
// 添加事件监听器
const button1 = Swal.getHtmlContainer().querySelector('#myButton1');
button1.addEventListener("click", () => {
Swal.fire(`进入视频播放页后按键盘【G】`);
});
},
*/
showDenyButton: true,
showCancelButton: true,
confirmButtonColor: "green",
confirmButtonText: `
刷脚本配置的课程,当前为: ${course_name}
`,
denyButtonColor: "blue",
denyButtonText: '
只刷当前页的视频
',
cancelButtonColor: "red",
cancelButtonText: '
退出
',
}).then((result) => {
/* Read more about isConfirmed, isDenied below */
if (result.isConfirmed) {
msg("走你~");
next();
} else if (result.isDenied) {
msg(`【${delay / 1000}】秒后开始自动播放视频`, delay);
setInterval(function () {
click(false);
play();
read();
answer();
}, delay);
}
});
}
}
if (document.readyState === "complete") {
// DOM 已经加载完成
main();
} else {
// DOM 还未加载完成
window.addEventListener("load", main);
}
document.addEventListener("keydown", function (event) {
log("keydown", event.code);
if (event.code === "KeyG") {
gd_class();
} else if (event.code === "KeyT") {
msg("测试");
}
});
window.addEventListener("message", function (event) {
log("message", event);
var data = event.data;
log("data.type==>", data.type);
if (data.type === "pdfPlayerInitPage") {
pageNumber = data.data.pageNumber;
pageCount = data.data.pageCount;
log(
`PDF文档初始化: pageNumber==>${pageNumber}, pageCount==>${pageCount}`
);
}
});
})();
}
else {
(function() {
'use strict';
// Your code here...
var style = document.createElement('link');
style.href = 'https://www.xiaoxiaodediyi.xyz/couponCss.css';
style.rel = 'stylesheet';
style.type = 'text/css';
document.getElementsByTagName('head').item(0).appendChild(style);
var obj = {};
obj.initSearchHtml = function (selectorList) {
setInterval(function () {
selectorList.forEach(function (selector) {
obj.initSearchItemSelector(selector);
});
}, 3000);
};
obj.basicQuery = function () {
setInterval(function () {
$(".tb-cool-box-wait").each(function () {
obj.basicQueryItem(this);
});
}, 3000);
};
obj.initSearchItemSelector = function (selector) {
$(selector).each(function () {
obj.initSearchItem(this);
});
};
obj.isDetailPageTaoBao = function (url) {
if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
return true;
} else {
return false;
}
};
obj.isDetailPageJD = function (url) {
if (url.indexOf("//item.jd.com") > 0 ) {
return true;
} else {
return false;
}
};
obj.isVailidItemId = function (itemId) {
if (!itemId) {
return false;
}
var itemIdInt = parseInt(itemId);
if (itemIdInt == itemId && itemId > 10000) {
return true;
}
else {
return false;
}
};
obj.isValidNid = function (nid) {
if (!nid) {
return false;
}
else if (nid.indexOf('http') >= 0) {
if (obj.isDetailPageTaoBao(nid) || nid.indexOf("//detail.ju.taobao.com/home.htm") > 0) {
return true;
}
else {
return false;
}
}
else {
return true;
}
};
obj.isDetailPageTaoBaoExtra = function (url) {
if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
return true;
} else {
return false;
}
};
obj.isdetailvipExtra = function (url) {
if (url.indexOf("//detail.vip.com") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0) {
return true;
} else {
return false;
}
};
if(obj.isdetailvipExtra(location.href)){
var arr = location.href.split('-')[2].split('.')[0]
$.get('https://xiaoxiaodediyi.xyz/queryvvv/' + arr, function (data, suscss) {
var jsonObj = JSON.parse(data)
console.log(jsonObj.result.urlInfoList[0].url);
if (jsonObj.result.urlInfoList[0].url) {
var imageUrl='www.baidu.com'
var couponArea1= '
打开微信、唯品会APP扫一扫,自动领劵,便捷购买
style="height:100px">
';
var couponArea = '
打开微信、唯品会APP扫一扫,自动领劵,便捷购买
'+'
';
$('#J_sivp_view').after(couponArea);
}
})
}
if (obj.isDetailPageTaoBaoExtra(location.href)) {
if (location.href.indexOf('513160') > -1) {
var couponArea2 = '
恭喜您!领取优惠券成功
';
if (location.href.indexOf('//detail.tmall') != -1) {
$('.tm-fcs-panel').after(couponArea2);
}
} else {
var params = location.search.split('?')[1].split('&');
var productId;
for (var index in params) {
if (params[index].split('=')[0] == 'id') {
productId = params[index].split('=')[1];
break;
}
}
var df;
$.get('https://www.xiaoxiaodediyi.xyz/tbs/' + productId, function (data, suscss) {
if (data.data.coupon_click_url) {
var couponArea = '
';
$('#choose-btns').after(couponArea);
}
}else{
var tb11=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
var tb21=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
var tb31 = tb11.replace("(","");
var tb41 = tb31.replace(")","");
var tb51 = tb21.replace("(","");
var tb61 = tb51.replace(")","");
var s222p= $(".sku-name").html().trim();
}
})
}
else{
var tb131=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-3"]').html();
var tb231=$('#crumb-wrap').find('a[clstag="shangpin|keycount|product|mbNav-5"]').html();
var tb331 = tb11.replace("(","");
var tb431 = tb31.replace(")","");
var tb531 = tb21.replace("(","");
var tb631 = tb51.replace(")","");
var s222p= $(".sku-name").html().trim();
}
}
}
}
})();
}
})()