This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
austinv11's profile picture

Simple Command Line GitHub Downloader

Started by austinv11, 20 January 2014 - 09:07 AM
austinv11 #1
Posted 20 January 2014 - 10:07 AM
This program is a very simple and quick way to download files off of GitHub

Just run: pastebin get V2pQK64w github
or if you want the API: pastebin get 2Bzjhx8h <your program's name>, then just write your program under the API

Commands (currently only one):
github get <user> <repo> <branch> <path> <topath>

API functions(currently only one):
gitGet(user, repo, branch, path, toPath) -returns false if download failed, true if it worked

Changelog:
Spoiler1.0:
-Initial release
1.1:
-Optimized Code
1.2
-Released API version of this
-Made it so that if toPath is not given, it equals path
1.3
-Added Support for standard computers
-Made all functions local

Note: I would love to have it be able to push commits, post bugs, etc. But I have no idea if it's possible without the OAuth API, let alone how to do it, so if you have an idea, please post it below.
Edited on 12 February 2014 - 07:30 PM
oeed #2
Posted 20 January 2014 - 06:47 PM
Note: I would love to have it be able to push commits, post bugs, etc. But I have no idea if it's possible, let alone how to do it, so if you have an idea, please post it below.

Looks good, I'd look in to the GitHub API. That way you can download entire repos and push stuff. (However, I think that you might need OAuth to push, which doesn't work in CC)
Edited on 20 January 2014 - 05:47 PM
austinv11 #3
Posted 20 January 2014 - 09:37 PM
Note: I would love to have it be able to push commits, post bugs, etc. But I have no idea if it's possible, let alone how to do it, so if you have an idea, please post it below.

Looks good, I'd look in to the GitHub API. That way you can download entire repos and push stuff. (However, I think that you might need OAuth to push, which doesn't work in CC)

Yeah that's the issue, I can't use the OAuth, but I'm trying to see if I could think of a workaround. I was just hoping the community would have ideas about this! :)/>
Edited on 20 January 2014 - 08:40 PM
Symmetryc #4
Posted 20 January 2014 - 10:22 PM
Why the sleep function call?
awsmazinggenius #5
Posted 20 January 2014 - 11:32 PM
You can host your own script, but then you can steal passwords. You might find some wrapper over this issue on the internet (I think I saw one once), but still, they might be malicious, too.
oeed #6
Posted 21 January 2014 - 12:34 AM
If you want I'll send you the code I use to download a repo if you like. Give me a PM if so.
austinv11 #7
Posted 21 January 2014 - 04:52 PM
Why the sleep function call?
Just for visual appeal :P/>
austinv11 #8
Posted 21 January 2014 - 04:57 PM
You can host your own script, but then you can steal passwords. You might find some wrapper over this issue on the internet (I think I saw one once), but still, they might be malicious, too.
I was thinking about that, but I have no idea how to go about safely doing this.
austinv11 #9
Posted 12 February 2014 - 08:31 PM
I finally included an overlooked feature; support for standard computers!