

pastebin get W5ZkVYSi gitget
pastebin get W5ZkVYSi gitget
Someone other than me actually uses it :o/>I'm going to try this until I get my own built. Thanks!
You can distribute the resultant program all you want, just remember to give me credit for the downloader somewhere in there ;)/>
Yep.May I use this in my new program called RemoteCon?
Absolutely, just add my name somewhere :P/>May I use this in my new program called RemoteCon?
This was designed to be simple and easy to use, as well as modular. I feel like a GUI would just slow it down.you could add an optional UI.
That's why it's supposed to be optional xDThis was designed to be simple and easy to use, as well as modular. I feel like a GUI would just slow it down.you could add an optional UI.
local function download(url, file)
save(http.get(url).readAll(),file)
end
Asynchronous requests might be faster as I could send them all in a single batch and then wait for the events for each, but I don't feel like speed is really a problem unless you're downloading OneOS or something else large.I'm impressed it only uses 1 API call. I thought you had to pass the SHA hash to get the tree instead (goes and edits installers).
Why don't you do requests asynchronously though? My installer for SEE and the OneOS installer both do this. I don't know if it is any quicker but it probably should be. I notice you don't check for http errors:local function download(url, file) save(http.get(url).readAll(),file) end
I've found that when downloading an entire repo, at least one file will fail at some time (it may just be my internet though). I guess you could just queue these failed files for another download until they have been tried 3 or so times.
I hope I don't sound too critical, I do think this code is pretty clever but those are just the things I would change.
What problems were you having with your repo? Often ones I've seen occur when you're out of API calls, or the computer is full. I haven't seen an API call usage error since the update that changed it from one call per folder to one call period, however.
Make's sense. It could also be a spam prevention measure or similar by GitHub.What problems were you having with your repo? Often ones I've seen occur when you're out of API calls, or the computer is full. I haven't seen an API call usage error since the update that changed it from one call per folder to one call period, however.
It wasn't with this script. Sometimes when downloading a lot of files a couple would 'get lost' and return a http_failure. Retrying each file normally sorted this. My computer's internet is pretty rubbish though so that is probably part of the reason.
Great idea I am already seeing the limitations of Pastebin one file at a time. This would be great tool for distributing your whole program library to new pc's in world.
Diamonds to you :-)
local username = "aepic999"
local repo = "MyProject"
function hte()
if fs.exists(gitget)
shell.run("gitget", username, repo)
else
print("GitGet application does not exist. Downloading...")
shell.run("pastebin", "get", "6aMMzdwd", "gitget")
shell.run("gitget", username, repo)
end
echo("Installed.")
end
if http then
print("HTTP enabled. You can continue.")
hte()
else
print("HTTP not enabled. App will not continue.")
end
while my other version that used get() was long, and I gave up when I reached the API folder.I.. sense.. AWESOMENESS!!
Now I can finally create an installer without creating a function called get(repo, file) and then calling it like a hundred times!!
Now, all I have to do is:while my other version that used get() was long, and I gave up when I reached the API folder.local username = "aepic999" local repo = "MyProject" function hte() if fs.exists(gitget) shell.run("gitget", username, repo) else print("GitGet application does not exist. Downloading...") shell.run("pastebin", "get", "6aMMzdwd", "gitget") shell.run("gitget", username, repo) end echo("Installed.") end if http then print("HTTP enabled. You can continue.") hte() else print("HTTP not enabled. App will not continue.") end
EDIT: Put a measure in there to make sure it doesn't still run the code when HTTP API is off.
EDIT 2: Put the hte() function directly after the variables so the if wouldn't get confused, nor the function.
EDIT 3: And just to note, if you want to make this your own, change "username" and "repo", but KEEP THEM STRINGS! If you don't, the shell.run() calls I use will fail.
EDITSAURUS: You can hard-code the strings (hardcoded: not in variable or dependent on variables).
local username = "aepic999"
local repo = "MyProject"
function hte()
if fs.exists(gitget) then --You missed this
shell.run("gitget", username, repo)
else
print("GitGet application does not exist. Downloading...")
shell.run("pastebin", "get", "6aMMzdwd", "gitget")
shell.run("gitget", username, repo)
end
if fs.exists("one of your files") then --You don't check if it was installed before saying it was installed
print("Installed.") -- echo?
else
print("An error occured while attempting to install.")
end
end
if http then
print("HTTP enabled. You can continue.")
hte()
else
print("HTTP not enabled. App will not continue.")
end
if http then
print("HTTP enabled. You can continue.")
hte()
else
print("HTTP not enabled. App will not continue.")
end
I hope my installer still works, because it literly(don't judge) runs gitget off pastebin.
edit: you made a new pasteID. Will update it to that though.
Woah. The new gitget is WAY faster.
Do you mind if I include this as a default program in my OS?
Most, if not all OSes give programs the Shell API. Mine does, it even uses it itself!
Try putting releases in a separate branch. Then you can use gitget2 to download just the necessary branch. For example, merge the latest "release" code into the branch "releases" and then run "gitget sandalle minecraft_bigreactor_control releases" to download it.Hey apemanzilla, thanks for putting this together. :)/>/> I was looking at ways to update https://github.com/sandalle/minecraft_bigreactor_control/ in pastebin via WebHooks, but pastebin only seems to allow for creating new entries and not updating existing ones with the API, plus I couldn't seem to modify the WebHooks to be very versatile in what they send to pastebin.
So, I'm looking at using this for pulling down updates, but I would like to only pull from the latest post in https://github.com/sandalle/minecraft_bigreactor_control/releases (see https://github.com/sandalle/minecraft_bigreactor_control/releases/latest for always latest release) and not every commit to master (since that's where semi-tested and untested code goes, especially when merging pull requests :)/>/>). I don't need the whole ZIP or .tar.gz file, just a specific file ( e.g. latest release is 0.3.16 with https://github.com/sandalle/minecraft_bigreactor_control/blob/lolmer_bigreactor-0.3.16/lolmer_bigreactor_monitor_prog.lua ), though grabbing the ZIP or .tar.gz and uncompressing would work, too.
I did not see gitget (nor gitget2) on https://github.com/apemanzilla?tab=repositories to submit an enhancement request. :)/>/>
May I turn GitGet into an API so I can use it for my program.