Skip to content

Commit

Permalink
Update the README and add a terrible homepage for the web
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleconroy committed Apr 6, 2012
1 parent bc44175 commit 7304d98
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
19 changes: 15 additions & 4 deletions README.md
@@ -1,22 +1,33 @@
# GitLicense # GitLicense


REST API for what license a project is under REST API for discovering the license for a github repository.


## Algorithm ## Usage


The current algorithm is really simple. I look for a `LICENSE` or `LICENSE.*` file, and see if it matches any of the licenses I support. curl -i http://gitlicense.herokuapp.com/:user/:repo

The return value will be a JSON object of the following form.

{
repo: ":user",
user: ":repo",
license: "MIT License"
}


### Supported Licenses ### Supported Licenses


* MIT license (MIT) * MIT license (MIT)
* ISC License (ISC) * ISC License (ISC)
* Apache License 2.0 (Apache-2.0) * Apache License 2.0 (Apache-2.0)
* GNU General Public License, version 2 (GPL-2.0)
* GNU General Public License, version 3 (GPL-3.0) * GNU General Public License, version 3 (GPL-3.0)
* GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL-3.0) * GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL-3.0)
* BSD License * BSD License
* Modified BSD License
* Artisitic License 2.0
* Mozilla Public License


## TODO ## TODO


* Improve the license matching algorithm * Improve the license matching algorithm
* Support more licenses


29 changes: 28 additions & 1 deletion web.py
@@ -1,4 +1,4 @@
from flask import Flask, jsonify, abort from flask import Flask, jsonify, abort, make_response
import os import os
import requests import requests
import json import json
Expand Down Expand Up @@ -172,6 +172,33 @@ def get_license(user, repo_name):


app = Flask(__name__) app = Flask(__name__)


@app.route("/")
def index():
index = """
<!DOCTYPE html>
<html>
<body>
<pre>
# GitLicense
REST API for discovering the license for a github repository.
## Usage
curl -i http://gitlicense.herokuapp.com/:user/:repo
The return value will be a JSON object of the following form.
{
repo: ":user",
user: ":repo",
license: "MIT License"
}
</pre>
</body>
</html>"""
return make_response(index)

@app.route("/<user>/<repo>") @app.route("/<user>/<repo>")
def index_with_url(user, repo): def index_with_url(user, repo):
try: try:
Expand Down

0 comments on commit 7304d98

Please sign in to comment.