forked from okfn/licenses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
255 lines (230 loc) · 9.18 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Licenses Service - an API for Open Licenses - from the Open Knowledge Foundation</title>
<meta name="description" content="">
<meta name="author" content="Open Knowledge Foundation">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="css/bootstrap.min.css">
<style type="text/css">
html, body {
background-color: #eee;
}
body {
padding-top: 40px;
}
.content {
background-color: #fff;
padding: 20px;
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.page-header {
background-color: #f5f5f5;
padding: 20px 20px 10px;
margin: -20px -20px 20px;
}
footer {
background-color: #f5f5f5;
padding: 20px 20px 20px;
margin: 15px -20px -20px;
border-top: solid 1px #eee;
}
.nav-logo img {
margin-top: 4px;
margin-right: 8px;
}
form.license-filter {
float: right;
display: inline;
}
.license-list {
margin-top: 20px;
clear: both;
}
.license .icons {
float: right;
display: inline;
}
.license .icons .open-icon {
padding-right: 3px;
}
</style>
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="nav-logo pull-left" href="http://okfn.org/" title="An Open Knowledge Foundation Project">
<img src="http://assets.okfn.org/p/okfn/img/logo_28x30.png" alt="Open Knowledge Foundation logo" />
</a>
<a class="brand" href="#">Open Definition Licenses Service</a>
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="#how-to">Use It</a></li>
<li><a href="#all-licenses">Licenses List</a></li>
</ul>
<ul class="nav pull-right">
<li><a href="http://github.com/okfn/licenses">Repo</a></li>
<li><a href="http://github.com/okfn/licenses/issues">Issues</a></li>
<li><a href="http://opendefinition.org/">Open Definition Home</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="content">
<div class="page-header">
<h1>Open Licenses Service <small><a href="http://opensource.org/">Open Source</a>, <a href="http://opendefinition.org/">Open Data and Open Content</a> Licenses in JSON and API friendly form</small></h1>
</div>
<blockquote>
<h2>The <a href="http://opendefinition.org">Open Definition</a> states: "A piece of content or data is open if anyone is free to use, reuse, and redistribute it — subject only, at most, to the requirement to attribute and share-alike."</h2>
</blockquote>
<div class="row">
<div class="span6">
<h3>Data on more than 100 open licenses</h3>
<p>Including all <a
href="http://opensource.org/licenses">OSI-approved open source
licenses</a> and all <a href="http://opendefinition.org/licenses">Open
Definition conformant open data and content licenses</a>. Provided in easy to use, <a href="#format">machine readable JSON</a> -- perfect if you need to drop a license chooser into your app.</p>
<p><a href="#all-licenses" class="btn primary">View the licenses available</a></p>
<h4>License Groups</h4>
<p>In addition various generic groups are provided that are useful when constructing license choice lists, including non-commercial options, generic Public Domain and more. Pre-packaged groups include:</p>
<ul>
<li><a href="licenses/groups/all.json">All licenses</a></li>
<li><a href="licenses/groups/osi.json">OSI compliant</a></li>
<li><a href="licenses/groups/od.json">Open Definition compliant</a></li>
<li><a href="licenses/groups/ckan.json">Specially selected set</a> developed for <a href="http://ckan.org/">CKAN</a> that is perfect for data and content site license choosers.
</ul>
</div>
<div class="span6">
<h3 id="format">Format</h3>
<p>JSON hashes with the following keys:</p>
<pre>{
"id": "ODC-BY-1.0",
"domain_content": false,
"domain_data": true,
"domain_software": false,
"od_conformance": "approved",
"osd_conformance": "not reviewed",
"status": "active",
"title": "Open Data Commons Attribution License 1.0",
"url": "http://opendatacommons.org/licenses/by"
}</pre>
<p>Spot an error, think we should have more info? Please file an <a href="http://github.com/okfn/licenses/issues">issue</a> or submit a patch.
.
</div>
</div>
<hr />
<h2 id="how-to">How do I use it?</h2>
<div class="row">
<div class="span6">
<h3>Get the data</h3>
<p>Download the licenses, either <a href="licenses/groups/all.json">all in one</a>, individually (see below) or in specific groups (see above).</p>
<p>For example, here's how to use curl to access an individual license:</p>
<p><code>curl http://licenses.opendefinition.org/licenses/odc-by.json</code></p>
<p>And here's how to use curl to access the CKAN license group:</p>
<p><code>curl http://licenses.opendefinition.org/licenses/groups/ckan.json</code></p>
<h3>Git Access</h3>
<p>You can also get the material as a git repo:</p>
<p><code>git clone http://github.com/okfn/licenses</code></p>
</div>
<div class="span6">
<h3>Javascript Access (JSONP)</h3>
<p>We also provide a simple way to get direct access from javascript in the browser using JSONP, by providing versions of the all of the data in the jsonp subdirectory wrapped in a callback function named <code>license_callback</code>.</p>
<p>Thus, the JSONP version of a file named:
<p><code>xyz.json</code></p>
<p>whether it is a license group or an individual license, will be located at:</p>
<p><code>licenses/jsonp/xyz.json</code></p>
For example from jQuery:</p>
<pre>
$.ajax({
url:'http://licenses.opendefinition.org/groups/jsonp/ODC-BY-1.0.js',
dataType: 'jsonp',
// you *must* set the callback function to be licenses_callback
jsonpCallback: 'license_callback',
success: function(data) {
alert('License title is ' + data.title);
}
});
</pre>
<div class="alert">
Because our JSONP data is served from a static files, it has a hardcoded callback function and therefore <strong>must</strong> name your callback function for the JSONP request <strong><code>license_callback</code></strong>.
</div>
</div>
</div>
<hr />
<h2 id="all-licenses">
Licenses List
<form class="form-horizontal form-search license-filter">
<input type="text" name="q" placeholder="Filter" class="search-query span5" />
<br />
<label class="checkbox">
<input type="checkbox" name="od_conformance" value="approved" checked="" />
Approved as conforming to the Open Definition
</label>
<label class="checkbox">
<input type="checkbox" name="osd_conformance" value="approved" />
Approved as conforming to the Open Source Definition
</label>
</form>
</h2>
<div class="license-list row"></div>
<footer>
<p>
The Licenses service is run by the <a href="http://okfn.org">Open
Knowledge Foundation</a>
</p>
<p>
<a href="http://github.com/okfn/licenses">Source Code and Data</a> – <a href="https://github.com/okfn/licenses/tree/master/licenses">Full License List in Repo</a></p>
</p>
<p>
<a href="http://opendefinition.org/ossd/" title="Open Online Software Service">
<img src="http://assets.okfn.org/images/ok_buttons/os_80x15_orange_grey.png" alt="" border="" />
</a>
</p>
</footer>
</div><!-- /content -->
</div><!-- /container -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script type="text/javascript">
// GLOBAL
var all_licenses = null;
// Setup callback for jsonp to use
function license_callback(data) {
all_licenses = data;
}
</script>
<script src="licenses/jsonp/all.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="x-template" class="template-license">
<div class="license span6" data-license-id="">
<div class="well">
<h3>
<a href="" class="tmpl-title"></a>
<div class="icons"></div>
</h3>
<p><a href="" class="tmpl-url"></a></p>
<p>Status: <span class="tmpl-status"></span></p>
</div>
</div>
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8271754-38']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>