mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
pastebin oops
This commit is contained in:
parent
a77d55e33f
commit
8220ed1066
@ -19,9 +19,9 @@ local function parseCode(paste)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Download the contents of a paste
|
-- Download the contents of a paste
|
||||||
local function download(url)
|
local function download(code)
|
||||||
if type(url) ~= "string" then
|
if type(url) ~= "string" then
|
||||||
error("bad argument #1 (expected string, got " .. type(url) .. ")", 2)
|
error("bad argument #1 (expected string, got " .. type(code) .. ")", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not http then
|
if not http then
|
||||||
@ -31,7 +31,7 @@ local function download(url)
|
|||||||
-- Add a cache buster so that spam protection is re-checked
|
-- Add a cache buster so that spam protection is re-checked
|
||||||
local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
|
local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30))
|
||||||
local response, err = http.get(
|
local response, err = http.get(
|
||||||
"https://pastebin.com/raw/" .. textutils.urlEncode(paste) .. "?cb=" .. cacheBuster
|
"https://pastebin.com/raw/" .. textutils.urlEncode(code) .. "?cb=" .. cacheBuster
|
||||||
)
|
)
|
||||||
|
|
||||||
if not response then
|
if not response then
|
||||||
|
@ -34,10 +34,10 @@ if sCommand == "put" then
|
|||||||
|
|
||||||
print( "Connecting to pastebin.com... " )
|
print( "Connecting to pastebin.com... " )
|
||||||
|
|
||||||
local resp, msg = pastebin.put(sFile)
|
local resp, msg = pastebin.put(sPath)
|
||||||
|
|
||||||
if resp then
|
if resp then
|
||||||
print( "Uploaded as "..msg )
|
print( "Uploaded as " .. resp )
|
||||||
print( "Run \"pastebin get "..resp.."\" to download anywhere" )
|
print( "Run \"pastebin get "..resp.."\" to download anywhere" )
|
||||||
|
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user