|
Post by leon26leon26 on Dec 14, 2015 21:49:47 GMT
I modified Tag's http get script to run and download pastebin scripts, then packed it into three functions. Run the script below to download the module off pastebin. Alternately, visit pastebin.com/9Nf2dF0L
function out(x) out=x end local http = require("socket.http") url="http://pastebin.com/raw.php?i=9Nf2dF0L" local request, statusCode, header = http.request({ method = "GET", url = url, sink = out, }) f=io.open("PastebinModule.lua","w") f:write(out) f:close() print("done!")
|
|
|
Post by warspyking on Dec 15, 2015 0:00:48 GMT
On roblox I made a module which allows you to interact with the whole pastebin API, you should do that for Touch Lua!
|
|
|
Post by leon26leon26 on Dec 15, 2015 6:51:25 GMT
On roblox I made a module which allows you to interact with the whole pastebin API, you should do that for Touch Lua! I'd like to make a pastebin.put(), but I have no idea how
|
|
|
Post by warspyking on Dec 15, 2015 10:37:46 GMT
|
|
|
Post by leon26leon26 on Dec 15, 2015 13:59:33 GMT
I had a quick look at that before, but now that I'm actually READING it, it makes much more sense xD
|
|
|
Post by warspyking on Dec 15, 2015 19:11:20 GMT
I had a quick look at that before, but now that I'm actually READING it, it makes much more sense xD Haha, usually does.
|
|
|
Post by leon26leon26 on Dec 15, 2015 21:21:01 GMT
Okay, I need help. What am I doing wrong?
function pastebin.put(text) function out(x) out=x end local http = require("socket.http") local request, statusCode, header = http.request({ api_paste_code=text, api_option="paste", api_dev_key=pastebin.dev_key, url="http://pastebin.com/api/api_post.php", sink=out, }) return out end
|
|
|
Post by warspyking on Dec 15, 2015 21:29:08 GMT
Okay, I need help. What am I doing wrong?
function pastebin.put(text) function out(x) out=x end local http = require("socket.http") local request, statusCode, header = http.request({ api_paste_code=text, api_option="paste", api_dev_key=pastebin.dev_key, url="http://pastebin.com/api/api_post.php", sink=out, }) return out end
You'll have to excuse me, tell me exactly what http.request does, is it a get request?
|
|
|
Post by leon26leon26 on Dec 15, 2015 22:03:56 GMT
Okay, I need help. What am I doing wrong?
function pastebin.put(text) function out(x) out=x end local http = require("socket.http") local request, statusCode, header = http.request({ api_paste_code=text, api_option="paste", api_dev_key=pastebin.dev_key, url="http://pastebin.com/api/api_post.php", sink=out, }) return out end
You'll have to excuse me, tell me exactly what http.request does, is it a get request? I have no idea xD But I think It's a general request, in tags example it had a method="GET" thing to it, I'm using api_option="paste" as stated in the pastebin api thing.
|
|
|
Post by warspyking on Dec 15, 2015 22:05:03 GMT
Another reason I hate using iPad is the way Touch Lua scales on it.
|
|
|
Post by warspyking on Dec 15, 2015 22:08:18 GMT
Well I'm gonna guess and give you the format I used
"?api_option=paste&next_argument=value"
And basically follow that format.
|
|
|
Post by leon26leon26 on Dec 16, 2015 5:43:02 GMT
Well I'm gonna guess and give you the format I used "?api_option=paste&next_argument=value" And basically follow that format. add to the url?
|
|
|
Post by warspyking on Dec 16, 2015 10:16:42 GMT
|
|
|
Post by leon26leon26 on Dec 16, 2015 10:31:51 GMT
tried that, didn't work in browser, nor in TouchLua. Still says invalid api_option.
|
|
|
Post by warspyking on Dec 16, 2015 12:09:54 GMT
tried that, didn't work in browser, nor in TouchLua. Still says invalid api_option. That error us basically a generic error when all else fails.
|
|