Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- --Variables
- local username = nil
- local password = nil
- local userkey = nil
- local key = "e98db6da803203282d172156bc46137c"
- local pastebin_url = nil
- print("Pastebin. Login.")
- write("Write your login: ")
- local username = read()
- write("Write your password: ")
- local password = read("*")
- print("Please wait...")
- local login = http.post(
- "http://pastebin.com/api/api_login.php",
- "api_dev_key="..key..
- "&api_user_name="..username..
- "&api_user_password="..password
- )
- if login then
- userkey = login.readAll()
- write("Success. Your userkey: " .. userkey)
- print("")
- print("")
- else
- login.close()
- error("Login failed.")
- end
- login.close()
- local sName = "SUPERTESTIDINAXUI"
- local sText = "This is code!"
- local response = http.post(
- "http://pastebin.com/api/api_post.php",
- "api_option=paste&"..
- "api_dev_key="..key.."&"..
- "api_user_key="..userkey.."&"..
- "api_paste_private=0&"..
- "api_paste_format=lua&"..
- "api_paste_name="..textutils.urlEncode(sName).."&"..
- "api_paste_code="..textutils.urlEncode(sText)
- )
- if response then
- pastebin_url = response.readAll()
- write("Success. Your pastebin: " .. pastebin_url)
- else
- print("Download failed.")
- end
- response.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement