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

GitHub Program Possibility

Started by Smiley43210, 07 May 2013 - 05:39 AM
Smiley43210 #1
Posted 07 May 2013 - 07:39 AM
So I remember seeing a thread about a program having GitHub functionality, but it got shut off since CC doesn't have the right HTTP stuff for it. But after thinking about it, couldn't one achieve the effect by using PHP? There are PHP libraries for GitHub (http://developer.github.com/v3/libraries/), and since CC can submit POST and GET requests, it could be possible. Right?
GravityScore #2
Posted 07 May 2013 - 08:44 AM
Yes, very possible. Not sure why no one has done it yet.
ardera #3
Posted 07 May 2013 - 09:48 AM
I've done an downloader for GH, and I'll release it very soon.

EDIT: You only need a json interpreter/translater or whatever, because the output of the GitHub API is json. (I found mine here: https://github.com/craigmj/json4lua/blob/master/json4lua/json/json.lua)
And a base64 decoder if you want to download files.
Lyqyd #4
Posted 07 May 2013 - 05:59 PM
Yes, very possible. Not sure why no one has done it yet.

Given the track record of programs for CC with PHP interfaces, I doubt very much that it would be a good idea to use any such program. A downloader for github is quite simple and requires none of that. Plus it's doable in thirty lines or so.
Smiley43210 #5
Posted 07 May 2013 - 06:47 PM
I meant not just downloading, but pushing and committing. And that part is possible with PHP.
Imque #6
Posted 07 May 2013 - 06:54 PM
I have already tried this and have files still for it.
superaxander #7
Posted 08 May 2013 - 07:20 AM
committing:


File CRUD

The repository contents API has allowed reading files for a while. Now you can easily commit changes to single files, just like you can in the web UI.

Starting today, these methods are available to you:
Espen #8
Posted 08 May 2013 - 09:09 PM
I meant not just downloading, but pushing and committing. And that part is possible with PHP.
While it's possible, it introduces a third-party which hosts the PHP-Server.
Everything works only over this server and clients don't know what the server is really doing.

So the main two problems I see are:
1. Trust in the person's intentions and competence
2. Availability of the PHP-Server/-Files

As a personal workaround it works of course. If I'd like to be able to do something like that I'd setup my own PHP "tunnel", so to speak.
But using the server of someone you only know superficially via a forum is not something that I can see many people wanting to do.
At least not for something serious where real login credentials are at stake. ^_^/>