Skip to content

Instantly share code, notes, and snippets.

@dangsonbk
Created February 13, 2019 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangsonbk/5c06c177e4c67c36043f8422a680e572 to your computer and use it in GitHub Desktop.
Save dangsonbk/5c06c177e4c67c36043f8422a680e572 to your computer and use it in GitHub Desktop.
Hanoi incoming bus info - In progress
import requests
import time
import json
headers = {
'Referer': 'http://timbus.vn/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.116',
'Origin': 'http://timbus.vn',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Connection': 'keep-alive',
}
data = [
('act', 'partremained'),
('State', 'false'),
('StationID', '586'),
('FleetOver', '33'),
]
while(True):
response = requests.post('http://timbus.vn/Engine/Business/Vehicle/action.ashx', headers=headers, data=data)
print(response.json()["dt"])
time.sleep(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment