	

    if not http then
      printError( "Pasteee requires the http API" )
      printError( "Set http_enable to true in ComputerCraft.cfg" )
      return
    end
     
    if not fs.exists(".JSONAPI") then
      local http_handler = http.get("http://regex.info/code/JSON.lua")
      local file_handler = fs.open(".JSONAPI","w")
      file_handler.write(http_handler.readAll())
      file_handler.close()
      http_handler.close()
    end
     
    local JSON = (loadfile ".JSONAPI")()
     
    local function printUsage()
        print( "Usages:" )
        print( "pasteee put <filename>" )
        print( "pasteee get <code> <filename>" )
        print( "pasteee run <code> <arguments>" )
    end
     
    local tArgs = { ... }
    if #tArgs < 2 then
        printUsage()
        return
    end
     
    local function get(paste)
        write( "Connecting to paste.ee... " )
        local response = http.get(
            "http://paste.ee/r/".. paste
        )
           
        if response then
            print( "Success." )
           
            local sResponse = response.readAll()
            response.close()
            return sResponse
        else
            printError( "Failed." )
        end
    end
     
    local sCommand = tArgs[1]
    if sCommand == "put" then
        -- Upload a file to paste.ee
        -- Determine file to upload
        local sFile = tArgs[2]
        local sPath = shell.resolve( sFile )
        if not fs.exists( sPath ) or fs.isDir( sPath ) then
            print( "No such file" )
            return
        end
       
        -- Read in the file
        local sName = fs.getName( sPath )
        local file = fs.open( sPath, "r" )
        local sText = file.readAll()
        file.close()
       
        -- POST the contents to pastebin
        write( "Connecting to paste.ee... " )
        local key = "45e0aee8dea21080140bb15fb0e12b9f"
        local response = http.post(
            "http://paste.ee/api",
            "key="..key.."&"..
            "language=lua&"..
            "description="..textutils.urlEncode(sName).."&"..
            "paste="..textutils.urlEncode(sText)
        )
           
        if response then
            print( "Success." )
           
            local sResponse = response.readAll()
            response.close()
                   
            local sCode = JSON:decode(sResponse)["paste"].id
            print( "Uploaded as "..sName)
            print( "Run \"pasteee get "..sCode.."\" to download anywhere" )
     
        else
            print( "Failed." )
        end
       
    elseif sCommand == "get" then
        -- Download a file from pasteee.com
        if #tArgs < 3 then
            printUsage()
            return
        end
     
        -- Determine file to download
        local sCode = tArgs[2]
        local sFile = tArgs[3]
        local sPath = shell.resolve( sFile )
        if fs.exists( sPath ) then
            print( "File already exists" )
            return
        end
       
        -- GET the contents from pastebin
        local res = get(sCode)
        if res then        
            local file = fs.open( sPath, "w" )
            file.write( res )
            file.close()
           
            print( "Downloaded as "..sFile )
        end
    elseif sCommand == "run" then
        local sCode = tArgs[2]
     
        local res = get(sCode)
        if res then
            local func, err = loadstring(res)
            if not func then
                printError( err )
                return
            end
            setfenv(func, getfenv())
            local success, msg = pcall(func, unpack(tArgs, 3))
            if not success then
                printError( msg )
            end
        end
    else
        printUsage()
        return
    end
