RoutePrt

route the route

当前为 2023-11-25 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         RoutePrt
// @namespace    http://www.conanluo.com/
// @version      1.1.1
// @description  route the route
// @author       Conan
// @match        https://*.itinerisonline.com/*
// @require      https://code.jquery.com/jquery-2.2.4.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=itinerisonline.com
// @grant        none
// ==/UserScript==

(function() {// testing

    'use strict';
    let addrs={"14 Roemer Way":"11","1066 Mission Street":"4","1100 Van Ness Avenue":"4","1234 McAllister Street #2N":"8","1240 Fillmore Street #511":"8","1250 Pierce Street":"8","1285 Monterey Boulevard":"3","129 Girard Street":"6","1301 Stevenson Boulevard #316":"0","1316 Stockton Street #18":"3","1321 Mission Street #206":"4","1333 Bush Street":"4","1420 Hampshire Street":"5","1423 32nd Avenue":"10","1444 McAllister Street":"8","1458 21st Avenue":"10","1499 Webster St":"8","1510 Jerrold Avenue":"5","1542 36th Avenue":"9","1551 Hyde Street #1":"3","159 Bright Street":"2","159 Sagamore Street":"2","1634 41st Avenue":"9","1635 23rd Avenue":"10","1645 Pacific Avenue":"3","1660 Geary Boulevard":"0","1667 Silver Avenue":"5","1675 Scott Street":"0","1683 44th Avenue":"9","1722 Turk Street":"8","1723 Geneva Avenue":"6","174 Ellis Street #708":"4","1797 Ellis Street":"8","1814 32nd Avenue":"10","1870 36th Avenue":"9","1880 Pine Street #703":"3","1927 32nd Avenue":"10","1937 20th Avenue":"10","2014 34th Avenue":"9","2034 34th Avenue":"9","2051 46th Avenue":"9","2107 O'Farrell Street":"0","211 Sweeny Street":"6","2141 Geary Boulevard APT 101":"8","2143 21st Avenue":"10","216 Eddy Street #421":"4","2179 30th Avenue":"10","2187 30th Avenue":"10","2191 45th Avenue":"9","225 30th Street":"1","23 Glenview Drive":"2","2330 Post Street 6th Floor":"8","2340 Turk Boulevard":"2","2351 20th Avenue":"10","2456 Geary Boulevard":"8","2459 28th Avenue":"10","2517 Post Street":"8","2595 43rd Avenue #3":"9","2611 34th Avenue":"9","2698 California Street Apt C":"3","27 Hollywood Court":"2","2770 Lombard Street #101":"3","320 Clementina Street #608":"4","350 Ellis Street #4e":"4","350 Gaven Street":"6","350 University Street":"6","355 Faxon Avenue":"2","3575 Geary Boulevard":"0","358 21st Avenue #2":"1","3595 Geary Boulevard":"0","3595 Geary Boulevard #533":"0","364 4th Avenue #a":"1","365 Fulton Street #405":"1","367 Hale Street":"6","3683 Peralta Boulevard":"5","370 Valencia Street #310":"5","3981 Alemany Boulevard APT 214":"2","4116 Ulloa Street":"9","420 Berry Street #435":"4","4220 Judah Street #101":"9","425 Eddy Street":"4","426 Burrows Street":"6","465 11th Avenue":"1","4735 California Street #2":"1","4830 Mission Street #304":"2","491 31st Avenue #215":"1","500 33rd Avenue #4":"1","506 41st Avenue":"1","5328 Fulton Street":"1","562 6th Avenue #9":"1","5628 California Street":"1","5717 Geary Boulevard":"1","580 Capp Street #215":"5","614 7th Avenue":"1","622 Geneva Avenue":"6","627 21st Avenue":"1","640 Turk Street #3":"4","688 27th Street":"1","701 Golden Gate Avenue #514":"8","706 Columbus Avenue":"3","711 Pacific Avenue #315":"3","737 Folsom Street #607":"4","76 Newton Street":"2","770 18th Avenue":"1","779 15th Avenue":"1","848 Kearny Street #713":"3","858 Washington Street #23":"3","890 29th Avenue":"1","990 Polk Street #404":"4","995 Brussels Street":"6"}

let colors=["000000","b51548","188225","f3b6a3","e95468","443ea1","b1f9d1","777777","01b4fa","f685e6","e08536","dddddd"]

    let address=[];
    $("body").prepend(`<button id="ch" class='btn btn-success'>Hight Light Route</button>`)

    $("#ch").click(function(){
        async function delay(time){
            return new Promise((res,rej)=>{
                setTimeout(_=>res(),time)
            })
        }
        (async () => {
            let da=document.getElementsByClassName("table table-condensed table-hover selectable")[0].getElementsByTagName("tr");
            for(let i=0;i<da.length;i++){
                if(i<da.length/2){
                    if((da[i].innerText+"").indexOf("\tPU")>-1){
                        da[i].click();
                        let name=da[i].innerText.split("\tPU ")[1].split("\t")[0]
                        await delay(100);
                        let prt=document.getElementsByClassName("da selected")[0]
                        prt.innerText=name
                        //$(prt).css("background-color","red")
                        changeBg(da[i],prt,1)
                    }
                }else{
                    if((da[i].innerText).indexOf("\tDO")>-1){
                        da[i].click();
                        let name=da[i].innerText.split("\tDO ")[1].split("\t")[0]
                        await delay(100);
                        let prt=document.getElementsByClassName("da selected")[0]
                        prt.innerText=name
                        //$(prt).css("background-color","red")
                        changeBg(da[i],prt,2)
                    }
                }
            }
            // $("#ch").text(address.join("@"))
        })();
    })
    // Your code here...

    function changeBg(da,prt,type){
        let color=type==1?"red":"green";
        let slt=type==1?"\tPU ":"\tDO ";
        let name=da.innerText.split(slt)[1].split("\t")[0];
        let addr=da.innerText.split("\t")[6];
        address.push(addr)
console.log(addrs[addr.replace(", San Francisco","")]);
        $(prt).css("background-color","#"+colors[addrs[addr.replace(", San Francisco","")]])
        // $(prt).css("background-color","#999999")
    }
})();