Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function get(paste)
- local response = http.get(
- "http://raw.github.com/DiabolusNeil/testingRepo/master/"..textutils.urlEncode(paste)
- )
- if response then
- print("Success")
- local sResponse = response.readAll()
- response.close()
- return sResponse
- else
- print("Failed")
- response.close()
- end
- end
- local res = get("prog")
- if res then
- wFile = fs.open("testing","w")
- wFile.write(res)
- print(res)
- wFile.close()
- print("Downloaded 'prog'")
- else
- print("Error")
- end
Advertisement
Add Comment
Please, Sign In to add comment