Mecha CMS

Updates.

Mecha’s GitHub API

Table of Content

I’m creating some public GitHub API for our control panel extension.

So, recently I made a number of API to quickly display my repository status on GitHub. But then I decided to make it public (can be used to display other people’s repositories). I hope this will not burden my shared hosting server, haha! 😆

Update 2019/01/01: To prevent massive requests and to save my bandwidth quota, I have set the cache header for about an hour for every page request.

Status 

https://mecha-cms.com/git/status/<user>/<repository>
https://mecha-cms.com/git/status/<user>/<repository>/<output>

Example:

https://mecha-cms.com/git/status/mecha-cms/mecha
https://mecha-cms.com/git/status/mecha-cms/mecha/star

Tree 

https://mecha-cms.com/git/tree/<user>/<repository>

Supported parameters:

ParameterDescription
versionUsed to list specific version.
rawUsed to view the blob data as plain text.
markHighlight code at the specified line or range.
skinDefine syntax highlighter theme name (experimental).

Example:

https://mecha-cms.com/git/tree/mecha-cms/mecha
https://mecha-cms.com/git/tree/mecha-cms/mecha?version=1.2.8
https://mecha-cms.com/git/tree/mecha-cms/mecha?version=362af652bc47f98ca0012bdad89625f180728695
https://mecha-cms.com/git/tree/mecha-cms/genome/index.php?mark=30
https://mecha-cms.com/git/tree/mecha-cms/genome/index.php?mark=30,49,50
https://mecha-cms.com/git/tree/mecha-cms/genome/index.php?mark=3-9
https://mecha-cms.com/git/tree/mecha-cms/genome/index.php?mark=3-9,37-38
https://mecha-cms.com/git/tree/mecha-cms/genome/index.php?skin=monokai

Version 

https://mecha-cms.com/git/version/<user>/<repository>

Supported parameters:

ParameterDescription
pullUsed to download the package. The value can be zip or tar.

Example:

https://mecha-cms.com/git/version/mecha-cms/mecha
https://mecha-cms.com/git/version/mecha-cms/mecha?pull=zip