From 8220ed106679cd69d49e3d736b7bf0d031db009f Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Fri, 12 Apr 2019 08:55:38 -0400 Subject: [PATCH] pastebin oops --- sys/apis/http/pastebin.lua | 6 +++--- sys/apps/pastebin.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/apis/http/pastebin.lua b/sys/apis/http/pastebin.lua index 343a7db..89676ba 100644 --- a/sys/apis/http/pastebin.lua +++ b/sys/apis/http/pastebin.lua @@ -19,9 +19,9 @@ local function parseCode(paste) end -- Download the contents of a paste -local function download(url) +local function download(code) 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 if not http then @@ -31,7 +31,7 @@ local function download(url) -- Add a cache buster so that spam protection is re-checked local cacheBuster = ("%x"):format(math.random(0, 2 ^ 30)) 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 diff --git a/sys/apps/pastebin.lua b/sys/apps/pastebin.lua index d2ee048..cff33db 100644 --- a/sys/apps/pastebin.lua +++ b/sys/apps/pastebin.lua @@ -34,10 +34,10 @@ if sCommand == "put" then print( "Connecting to pastebin.com... " ) - local resp, msg = pastebin.put(sFile) + local resp, msg = pastebin.put(sPath) if resp then - print( "Uploaded as "..msg ) + print( "Uploaded as " .. resp ) print( "Run \"pastebin get "..resp.."\" to download anywhere" ) else