Advertisement
Guest User

WebApi

a guest
Jul 28th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local forward = "forward"
  2. local back = "back"
  3. local right = "right"
  4. local left = "left"
  5. while true do
  6.  http.request( "https://api.thingspeak.com/apps/thinghttp/send_request?api_key=RZO9FEYJHYKDFWZX" )
  7.  event, url, handle = os.pullEvent( "http_success" )
  8.  stri = handle.readAll()
  9.  k = string.sub(stri,2,string.len(stri)-1)
  10.  local file = io.open("program", "w")
  11.  file:write(k)
  12.  file:close()
  13.  shell.run("program")
  14.  http.request( "https://api.thingspeak.com/apps/thinghttp/send_request?api_key=IFCX2RBYP668QO5Q" )
  15.  handle.close()
  16.  print ("End")
  17.  os.sleep(15)
  18.  print ("")
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement