· 5 years ago · Dec 18, 2020, 09:06 AM
1print("CONTENTSPEW API 0.1")
2print("MADE BY A DORK ON ADDERALL")
3function pastebinPutRet(file)
4 local directory = shell.resolve(file)
5 if fs.exists(directory) then
6 --load shit
7 local name = fs.getName(directory)
8 local loaded = fs.open(directory,"r")
9 local content = loaded.readAll()
10 loaded.close()
11 --write shit
12 local key = "sZ7wZe9IJ4Dh_6Dzh3iXzJXkvtRmWjZ-"
13 local response = http.post(
14 "https://pastebin.com/api/api_post.php",
15 "api_option=paste&"..
16 "api_dev_key="..key.."&"..
17 "api_paste_format=lua&"..
18 "api_paste_name="..textutils.urlEncode(name).."&"..
19 "api_paste_code="..textutils.urlEncode(content)
20 )
21 if response then
22 print("we got em fellas")
23 local parseResponse = response.readAll()
24 response.close()
25 local code = string.match(parseResponse,"[^/]+$")
26 return code
27 else
28 print("pastebin no likey")
29 end
30 else
31 print("directory of file does not exist, failed.")
32 end
33 return False
34end
35function binFolder(directory)
36 if fs.exists(directory) then
37 print("directory exists... ok!")
38 local files = fs.list(directory)
39 local lookupTable = {}
40 for _, file in ipairs(files) do
41 print(file.." needs to be uploaded!!")
42 yacode = pastebinPutRet(directory.."/"..file)
43 if yacode then
44 print(file.." is up @ "..yacode)
45 lookupTable[file]=yacode
46 else
47 print("fucked up on "..file)
48 end
49 end
50 return lookupTable
51 else
52 print("directory does not exist, failed.")
53 end
54end
55function generateImmortality(pastebinTable)
56 local temp = fs.open("immortalitydrive","w")
57 temp.writeLine("print(\"oh yeah, youre using a contentspew immortality drive baby\")")
58 print("generating an immortality bin!")
59 for k,v in pairs(pastebinTable) do
60 temp.writeLine("shell.run(\"pastebin get "..v.." contentspew/"..k.."\")")
61 end
62 temp.writeLine("print(\"oh yeah, now your shit is loaded into contentspew/!\")")
63 temp.writeLine("write(\"bitch\")")
64 temp.close()
65 imdrive = pastebinPutRet(temp)
66 if imdrive then
67 print("immortality drive created, bitch. find it at "..imdrive)
68 else
69 print("redonkulous. no immortality drive. die young bitch")
70 end
71end
72potim = binFolder("contentspew")
73generateImmortality(potim)