daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Feb 20th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. shiftUrl = 'https://parksapp-api.hkstp.org/api/v1/shuttle-bus?locale=en'
  3. ticketUrl = 'https://parksapp-api.hkstp.org/shuttle-bus/{shiftId}/ticket'
  4.  
  5. defaultHeaders = {
  6.     'X-APP-VERSION': '1.3.2',
  7.     'Authorization': 'bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTA3NTY5NDksInVzZXJfbmFtZSI6InNlcmVuYS5odWFuZ0ByYWRpY2FzeXMuY29tIiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJqdGkiOiIyMGEwM2VhMy01ZGJkLTQxYjctYjEyYS03ZWJhYmViMTVjYjYiLCJjbGllbnRfaWQiOiJ1c2VyLWFwcCIsInNjb3BlIjpbImFwaS51c2VyX2FwcCJdfQ.loBvdgeHwFxdlUMs53KorVZTU-3rtxe6OHrWAlLw1dX8HgmICQU_Jz5J9tOKz3C3Nf1_QBLb8UDfyo915lnuVCDXNo6nE8Y11JUetbG8ZlEKXBmpYSjThAXdt9zJJSqJDvX53VNHBzMApMhXXDubdurnko6Na7L80VxSKwnpdCvoffdI9OnNlrNr7fBAx5hwFfUmKfwapeIiJolvWKoJAWhbYyO6Iy31nm1WHXW5MHYP0wgXiwVfIDRLj9J09SHc9w2NUsSgmN3kcp_0SAmBql3YekXWZbMjjzx4YVgMtP7HildF9_uwYuIpnOS8r_sVk1LvJgo-kwKJxcihEzFBgA',
  8.     'User-Agent': 'Sony E5363 - Android 6.0 (API 23)',
  9.     'Accept': 'application/json',
  10.     'Content-Length': '0',
  11.     'Host': 'parksapp-api.hkstp.org',
  12.     'Connection': 'Keep-Alive',
  13.     'Accept-Encoding': 'gzip'
  14. }
  15.  
  16. def reserveATicket(shiftId):
  17.     r = requests.post(ticketUrl.format(shiftId=shiftId), headers=defaultHeaders)
  18.     print(r.status_code)
  19.     j = r.json()
  20.     print(j)
  21.  
  22. def getShift():
  23.     r = requests.get(shiftUrl, headers=defaultHeaders)
  24.     print(r.status_code)
  25.     j = r.json()
  26.     print(j)
  27.  
  28. if __name__ == "__main__":
  29.     option = sys.argv[1]
  30.     shiftId = sys.argv[2]
  31.     if option == 'POST':
  32.         for lp in range(100):
  33.             reserveATicket(shiftId)
  34.     else:
  35.         getShift()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top