Public platform development public platform development mode enterprise public platform train ticket interface train time interface train Review
Author: Fang Times studio
Original article: http://www.cnblogs.com/txw1958/p/weixin-43-train.html
I. Train query interface
Go to Baidu to find the interface
http://train.qunar.com/qunar/checiInfo.jsp?ex_track==t110=json=123456=1373813217828=XQScript_5
Q is the vehicle count
Server is the current timestamp in milliseconds
Cityname is 123456 for review
Ii. result data
Iii. Source Code
<?(getTrainInfo("t110" getTrainInfo( = (" ", = ([1].([0]*1000 = "http://train.qunar.com/qunar/checiInfo.jsp?ex_track=&q=".."&format=json&cityname=123456&ver=".."&callback=XQScript_5" = "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: en-us,en;q=0.5", "Referer: http://train.qunar.com/list_num.htm?fromStation=". =, CURLOPT_URL, , CURLOPT_RETURNTRANSFER, 1, CURLOPT_HTTPHEADER, = curl_exec( ?>
Iv. Legacy issues
The returned data is not arranged in order ......
Algorithm to be sorted again