终于学完了11段
赠送有车提示脚本
运行环境:办理网上约车+firefox+Greasemonkey+定时刷新
如果有车的话,跳出窗口提示
登录及约车操作需要手动完成
现在脚本只关注周末的有车情况,想关注其他天的请自行修改
脚本如下:
// ==UserScript==
// @name checkCar
// @namespace checkCar
// @description check the available cars
// @include http://yueche.woxche.com/NetBpkFrom.aspx
// ==/UserScript==
//
function checkHasCar(id) {
var haha=document.getElementById(id);
if(haha !=null && document.getElementById(id).src.match("mode2") == "mode2")
{
alert("有车,抓紧约");
}
}
var today=document.getElementById("ctl10_HyperLinkWeekID").innerHTML.replace(/.*(\d).gif.*/,'$1');
if(today == "0")
{
today = "7";
}
//获取目标id
var intrestDates=new Array();
var tmp=23+6-Number(today);
intrestDates[1]="ctl"+tmp+"_CmdBpk";
tmp=23+6-Number(today)+10;
intrestDates[2]="ctl"+tmp+"_CmdBpk";
tmp=23+6-Number(today)+20;
intrestDates[3]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today);
intrestDates[4]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today)+10;
intrestDates[5]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today)+20;
intrestDates[6]="ctl"+tmp+"_CmdBpk";
tmp=23+6-Number(today)+7;
intrestDates[7]="ctl"+tmp+"_CmdBpk";
tmp=23+6-Number(today)+10+7;
intrestDates[8]="ctl"+tmp+"_CmdBpk";
tmp=23+6-Number(today)+20+7;
intrestDates[9]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today)+7;
intrestDates[10]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today)+10+7;
intrestDates[11]="ctl"+tmp+"_CmdBpk";
tmp=23+7-Number(today)+20+7;
intrestDates[12]="ctl"+tmp+"_CmdBpk";
//intrestDates[13]="ctl24_CmdBpk";
for (i in intrestDates)
{
//检查是否有车
checkHasCar(intrestDates[i]);
}