Jump to content




Github Update Checker

api

2 replies to this topic

#1 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 03 January 2013 - 03:03 AM

this API is the first out of a set to make the user experience on github hosted apps better

a Downloader will follow and probably also a crash reporter

but lets get to the interesting part

Note that this API will not download any code for you

it will only check if the user is using the latest commit

using this API is very simple and looking at this example should probably tell you everything you need to know:
local updater = dofile("lib/updater.lua")

local function update()
print("done")
end
updater.new() -- this will check for any updates for the updater
updater.update(update, "Kolpa", "lol-pro-spectator") -- first argument is the function to be executed in case of an update second is the username and last is the repostery where the program is located


the json parsing in this API is done by David Kolf's JSON module which i highly recommend using for tasks like this

Download


Changelog

#2 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 04 January 2013 - 03:39 AM

bump added command to check and install updater updates also fixed a error with repos over 100 commits

#3 Eric

  • Members
  • 92 posts
  • LocationUK

Posted 10 January 2013 - 09:21 AM

You inspired me to make this, which does download all the code - it might be worth adding the update detection.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users