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

GitHub Gist client for CC

Started by hbar, 04 July 2013 - 06:17 AM
hbar #1
Posted 04 July 2013 - 08:17 AM
There was a post on the Feed the Beast subreddit that a Gist client would be useful. As I couldn't find anything on the subject on the internet and no-one was claiming to be making one, I decided to take a try.

So, here is a Gist client for CC. (GitHub page)

usage:

gist get <id>
gist put <file1> <file2> ...

It works basically the same as the default pastebin program, but allows for multiple files in one gist, so only a single numeric ID is required for downloading all of files of a project.

The HTTP api in CC doesn't currently support the use of headers, so only public gists can be downloaded and all uploads will be anonymous. However, I remember reading that header support might be coming in future versions. If and when, I'll add support for authenticating with GitHub so you can upload directly to your own account.

Suggestions and feedback are welcome.
UMayBleed #2
Posted 04 July 2013 - 03:53 PM
Nice work, could be useful. Though I do use all FTP program transfers. Or I use a custom PHP script for uploading that uses usernames/passwords. like
upload.php?user=usernamethingy&amp;pass=test&amp;session_id=3243265
Post data:
while true do
nothing in this.
end
airtonix #3
Posted 04 July 2013 - 09:19 PM
Nice work, could be useful. Though I do use all FTP program transfers. Or I use a custom PHP script for uploading that uses usernames/passwords. like
upload.php?user=usernamethingy&amp;pass=test&amp;session_id=3243265
Post data:
while true do
nothing in this.
end

I think you misunderstand the implications of gist vs pastebin. I mean what has PHP even got to do with this?
hbar #4
Posted 05 July 2013 - 04:21 AM
I think UMayBleed ment that you could use an external php code to handle the communication between GitHub and your code, and call that from the CC side. That would allow you to implement all of the features of Gist, instead of just the ones supported by the CC HTTP API. It's a good solution for personal projects, but I generally dislike the use of anything but pure CC, as then you are relying on some other server to be online, not just GitHub.
airtonix #5
Posted 05 July 2013 - 05:26 AM
I think UMayBleed ment that you could use an external php code to handle the communication between GitHub and your code, and call that from the CC side. That would allow you to implement all of the features of Gist, instead of just the ones supported by the CC HTTP API. It's a good solution for personal projects, but I generally dislike the use of anything but pure CC, as then you are relying on some other server to be online, not just GitHub.

Perhaps, but what you've done is sterling.
UMayBleed #6
Posted 06 July 2013 - 12:19 AM
What I am saying, instead of uploading to pastebin/github, I use a php script that uploads to my own website. then I use download.php to download it.