Creeper9207

location API

May 15th, 2015
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. --CreeperTech LLC. using ip-api.com
  2. --Heres something you should know:
  3. --some countries are too small to have regions/states
  4. --so I built in an error
  5. --if there is no region/state, it will return Error.noRegion
  6. --   -Creeper9207
  7. function getState()
  8. response = http.request("http://CreeperTech.net/SysX7/location.php?get=state")
  9. event, url, body = os.pullEvent()
  10. return body.readAll()
  11. end
  12. function getCity()
  13. response = http.request("http://CreeperTech.net/SysX7/location.php?get=city")
  14. event, url, body = os.pullEvent()
  15. return body.readAll()
  16. end
  17. function getCountry()
  18. response = http.request("http://CreeperTech.net/SysX7/location.php?get=country")
  19. event, url, body = os.pullEvent()
  20. return body.readAll()
  21. end
Advertisement
Add Comment
Please, Sign In to add comment