Advertisement
Guest User

Untitled

a guest
May 31st, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. LOGIN_URL = "https://i.exeter.ac.uk/selectProfile?return_url=%2Faek%2Fc%2Faekcb84e21d94e97ed9e"
  2. URL = "https://i.exeter.ac.uk/aek/c/aekcb84e21d94e97ed9e"
  3.  
  4. function dump(o)
  5.    if type(o) == 'table' then
  6.       local s = '{ '
  7.       for k,v in pairs(o) do
  8.          if type(k) ~= 'number' then k = '"'..k..'"' end
  9.          s = s .. '['..k..'] = ' .. dump(v) .. ','
  10.       end
  11.       return s .. '} '
  12.    else
  13.       return tostring(o)
  14.    end
  15. end
  16.  
  17. function main()
  18.     write("Please enter username:")
  19.     local user = read("*")
  20.     write("Please enter password")
  21.     local pass = read("*")
  22.  
  23.     local post_data = "ombl_service_username_180="..textutils.urlEncode(tostring(user)).."&".."ombl_service_password_180="..textutils.urlEncode(tostring(pass))
  24.  
  25.     http.post(LOGIN_URL, post_data)
  26.     while true do
  27.         data = http.get(URL)
  28.         os.sleep(60*2)
  29.         write(dump(data))
  30.     end
  31.    
  32.  
  33. end
  34.  
  35. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement