// ==UserScript== // @icon http://gw.alicdn.com/tfs/TB1MUjqiCzqK1RjSZFpXXakSXXa-100-100.png // @name 下载hga030每日赛事 // @namespace http://www.phiex.top // @author phiex // @description 下载hga030每日赛事到本地excel // @include http*://205.201.1.199/app/member/account/index.php // @include http*://205.201.1.201/app/member/account/index.php // @include http*://hga030.com/app/member/account/index.php // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js // @version 1.0.1 // @grant GM_download // @grant GM_openInTab // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @grant GM_addStyle // @grant unsafeWindow // @grant GM_getResourceURL // @grant GM_getResourceText // @downloadURL https://update.greasyfork.icu/scripts/389580/%E4%B8%8B%E8%BD%BDhga030%E6%AF%8F%E6%97%A5%E8%B5%9B%E4%BA%8B.user.js // @updateURL https://update.greasyfork.icu/scripts/389580/%E4%B8%8B%E8%BD%BDhga030%E6%AF%8F%E6%97%A5%E8%B5%9B%E4%BA%8B.meta.js // ==/UserScript== ; (function () { // 获取赛事 function catchMatch() { // 以下提取赛事 let $stateDiv = $("iframe#body").contents().find("#div_state"); // let gtype = $("#sel_gtype", $stateDiv).text() // let sel_type = $("#sel_type", $stateDiv).text() // let date_start = $("#date_start", $stateDiv).text() // console.log(gtype, sel_type, " ", date_start) // 获取联赛 let groupQ = $("#results_tableLine", $stateDiv).find("tr.acc_results_league") let hostQ = $("#results_tableLine", $stateDiv).find("tr.acc_result_tr_top") let gustQ = $("#results_tableLine", $stateDiv).find("tr.acc_result_tr_other") let matchQuan = groupQ.length let matchs = [] for (let i = 0; i < matchQuan; i++) { let match = {} match.group = $(groupQ[i]).text().trim() // 联赛 let info1 = $(hostQ[i]).text().trim().split("\n") match.date = info1[0].trim().substr(0, 5); // 日期 match.time = info1[0].trim().substr(5); // 时间 match.host = info1[1].trim(); // 主队 match.hscore = info1[2].trim(); // 主队得分 let info2 = $(gustQ[i]).text().trim().split("\n"); match.guest = info2[0].trim(); match.gscore = info2[1].trim(); matchs.push(match) } console.log("获取赛事: " + matchs.length) return matchs } // 合成表格 function composeTab(matchs) { // 以下合成表格 let matchTab = // `
日期 | 时间 | 联赛 | 主队 | 客队 | 投注内容 | 赔率 | 下注 | 比分 | 备注 | 输赢 | ` : ` | `; console.log(tdFlag) matchTab += ` |