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

[0.1] gh-dl - a GitHub downloader

Started by ardera, 07 May 2013 - 08:05 AM
ardera #1
Posted 07 May 2013 - 10:05 AM
gh-dl - a GitHub downloader

[indent=1]I just found an API for GitHub, and how you can use it, and since it was very easy to use I decided to make a GitHub downloader. It's very easy, and has no ui, but it does what it has to.[/indent]
[indent=1]It's in Beta, and I'll add an possibility to download file trees later. The biggest problem is, that the GitHub API has a access limit, you can only access the API 60 times per hour, so downloading[/indent]
[indent=1]a repo with more than 60 files would be a bit… problematic :/ But I think I could set up a central server that could get an API access upgrade (You have to ask GitHub to get such an upgrade, then you can send 5000 API requests per hour :3) and redirect the requests to access the GitHub API to the central server.[/indent]

Changelog
Spoiler0.1: ~Initial release

~dl: pastebin.com/tcY3cJnn

Download
pastebin.com/tcY3cJnn
or

pastebin get tcY3cJnn gh-dl
Sammich Lord #2
Posted 07 May 2013 - 11:47 AM
People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.
superaxander #3
Posted 07 May 2013 - 11:51 AM
This is prettig good!
ardera #4
Posted 07 May 2013 - 01:58 PM
People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.
I didn't know that there was a way to download the files using the raw subdomain of github. I tried to use it, but it seems that you can't list files in a directory. If it works, I'll use that and not the API of course. (PS: It throws an 404 error if I try to list a dir)


This is prettig good!
Thanks :)/>
Bubba #5
Posted 07 May 2013 - 02:08 PM
People have made GitHub downloaders that just accessed the raw download links. I don't see why you would want to use the API over just the raw download URLs. Unless, you can download a whole repo and once and/or list files in the repo to download.
I didn't know that there was a way to download the files using the raw subdomain of github. I tried to use it, but it seems that you can't list files in a directory. If it works, I'll use that and not the API of course. (PS: It throws an 404 error if I try to list a dir)

Yup. Just use raw.github.com/username/project/branch/file. Like this:

https://raw.github.com/AliquotMesozoic/Lunar/master/lunar
I don't believe you can list a directory contents though using raw, so that's a downside.
ardera #6
Posted 07 May 2013 - 02:26 PM
-snip-
I don't believe you can list a directory contents though using raw, so that's a downside.

Yep, thats what I meant, but I think I can make it "hybrid", so that it uses raw.github.com to download the files and api.github.com to list the directories.
Lyqyd #7
Posted 07 May 2013 - 06:01 PM
-snip-
I don't believe you can list a directory contents though using raw, so that's a downside.

Yep, thats what I meant, but I think I can make it "hybrid", so that it uses raw.github.com to download the files and api.github.com to list the directories.

Yeah, that API and raw combination is what my package manager project (cc-packman on my github) uses to fetch an entire repo. I'm not sure why you would want to use just one or the other.