I would like to know if GitHub raw view would work with the HTTP Api if you are trying to make an update program. Would it? It would be helpful if it did, as I don't want to make a Pastebin account with a password I'd probbably forget.
0
[Question] Would GitHub work with the HTTP api?
Started by digpoe, Nov 09 2012 07:36 AM
9 replies to this topic
#1
Posted 09 November 2012 - 07:36 AM
#2
Posted 09 November 2012 - 07:39 AM
Yes but you would also need a file to tell you where all the files you need to download are
#3
Posted 09 November 2012 - 07:41 AM
PixelToast, on 09 November 2012 - 07:39 AM, said:
Yes but you would also need a file to tell you where all the files you need to download are
#4
Posted 09 November 2012 - 07:55 AM
Yes, the https protocol is supported.
#5
Posted 09 November 2012 - 08:04 AM
Ok, thanks. But it seems I am getting errors.... Here's my code: https://raw.github.c...ster/updatetest
I don't get why it doesn't work, it should function fine.
The code i'm using in MC is:
I don't get why it doesn't work, it should function fine.
The code i'm using in MC is:
local version = 0 function versioncheck() term.clear() term.setCursorPos(1,1) print("Program loading...") print("Current version: "..version) local updateSite = http.get("https://raw.github.com/DigiTechs/Minecraftstuff/6bcf62fd71421eb5182605068f93c228f78b172b/updatetest") local coding = updateSite.readLine(2) local newVersion = (tonumber(coding)) sleep(2) if tonumber(newVersion) > version then print("Newest version is: "..newVersion) print("Update required. Updating now...") local updateSite = http.get("https://raw.github.com/DigiTechs/Minecraftstuff/6bcf62fd71421eb5182605068f93c228f78b172b/updatetest") local siteFile = updateSite.readAll() local writeFile = fs.open(shell.getRunningProgram(),"w") writeFile.write(siteFile) writeFile.close() print("The program will now restart your computer.") sleep(2) os.reboot() end end
#6
Posted 09 November 2012 - 08:44 AM
Please post a error log. Are you trying to pull a commit or what? Or do you have a folder named "6bcf62fd71421eb5182605068f93c228f78b172b"?
#7
Posted 09 November 2012 - 08:45 AM
What version of ComputerCraft are you using?
#9
Posted 09 November 2012 - 09:05 AM
Human, on 09 November 2012 - 08:44 AM, said:
Please post a error log. Are you trying to pull a commit or what? Or do you have a folder named "6bcf62fd71421eb5182605068f93c228f78b172b"?
I'm getting no errors from the game, it just runs and "does nothing" - The actual link to get to the raw file is https://raw.github.c...172b/updatetest - and I belive the 6bdcf thing is just the commit info.
#10
Posted 09 November 2012 - 09:13 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users