北京公交官网的Web API变了,新加了个selBStop参数:
http://www.bjbus.com/home/js/2014/jquery.rtbus.js
楼主的Python程序要稍微改一下。
这是北京公交官网的Web API对应的JavaScript片段。
可见其多了个selBStop参数:
$('#searchBS').click(function(){
var htmlobj = $.ajax({
url: "ajax_rtbus_data.php",
type: "GET",
async: true,
data: "act=busTime&selBLine="+selBLine+"&selBDir="+selBDir+"&selBStop="+selBStop,
dataType: "json",
success: function(data, textStatus){
if(data.err != undefined){
alert(data.err);
}else{
$("#station_info").html(data.html);
$("#cc_stop ul").css("width", data.w);
$("#station").show();
var container = $('#cc_stop'),scrollTo = $("#"+data.seq);
container.scrollLeft(
scrollTo.offset().left - container.offset().left + container.scrollLeft() - 450
);
container.animate({
scrollTop: scrollTo.offset().left - container.offset().left + container.scrollLeft()
});
clearInterval(timeout);
timeout = setInterval(getBusGPS, 15000); // 1s鎵ц涓€娆tnCount
getLTurl();
}
}
});
});
|