-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopen_data_world_cup.pdf.html
760 lines (548 loc) · 19.9 KB
/
open_data_world_cup.pdf.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using Open Football Data - Get Ready for the World Cup in Brazil 2014 w/ Ruby</title>
<style>
html, body { margin: 0; padding: 0; }
body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }
a:link, a:visited { color: black; }
h1 { font-size: 30pt; }
h2 { font-size: 28pt; }
h3 { font-size: 25pt; }
p, li, dt, dd, td, th { font-size: 18pt; }
pre { font-size: 14pt; }
pre.small { font-size: 11pt; }
pre.code {
background-color: azure;
padding: 5px;
}
ul { list-style-type: square; }
.center { text-align: center; }
.slide { page-break-after: always;
min-height: 100mm;
padding: 40px;
border: 1px dotted black;
/*
background: -moz-linear-gradient( top, maroon, red);
*/
}
pre {
padding: 4px 4px 4px 4px;
border-top: #bbb 1px solid;
border-bottom: #bbb 1px solid;
background: #f3f3f3;
}
/*
for princexml (CSS3 paged media support)
@page { size: A4 landscape }
*/
</style>
</head>
<body>
<div class="presentation">
<div class='slide '>
<!-- === begin markdown block ===
generated by markdown 1.1.1 on Ruby 1.9.2 (2011-07-09) [i386-mingw32]
on 2014-03-12 14:20:30 +0100 with Markdown engine kramdown (1.2.0)
using options {}
-->
<!-- _S9SLIDE_ -->
<h1 id="using-open-football-data---get-ready-for-the-world-cup-in-brazil-2014-w-ruby">Using Open Football Data - Get Ready for the World Cup in Brazil 2014 w/ Ruby</h1>
<h3 id="agenda">Agenda</h3>
<ul>
<li>The State of Open Data - World Cup in Brazil 2014</li>
<li>Do-It-Yourself – Let’s Build <code>football.db</code> - Open Football Data</li>
<li>Do-It-Yourself – What Wiki Package to Use?</li>
<li>Do-It-Yourself – What Source Format to Use?</li>
<li>Ruby, Ruby, Ruby – <code>sportdb</code> Ruby Gem</li>
<li>How to use <code>football.db</code> in Ruby - Models </li>
<li>How to use <code>football.db</code> with HTTP JSON(P) API</li>
<li>More Goodies - Examples Web Apps and Books</li>
<li>Bonus: License – What is Public Domain? Why Public Domain?</li>
<li>Bonus: Beer? Wine? Alpine Ski? Formula 1?</li>
<li>Bonus: How to use HTTP JSON API - <code>GET /beer/guinness</code></li>
</ul>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="world-cup-in-brazil-2014---the-worlds-biggest-sport-event">World Cup in Brazil 2014 - The World’s Biggest (Sport) Event</h1>
<p>When:</p>
<ul>
<li>25 (match)days – 12 June - 13 July</li>
</ul>
<p>Where:</p>
<ul>
<li>12 cities – Rio de Janeiro, São Paulo, Brasília, Fortaleza,
Belo Horizonte, Porto Alegre, Salvador, Recife,
Cuiabá, Manaus, Natal, Curitiba</li>
</ul>
<p>Teams:</p>
<ul>
<li>32 teams – Australia, Iran, Japan, South Korea,
Algeria, Cameroon, Ghana, Ivory Coast, Nigeria,
Costa Rica, Honduras, Mexico, United States,
Argentina, Brazil, Chile, Colombia, Ecuador,
Uruguay, Belgium, Bosnia and Herzegovina,
Croatia, England, France, Germany,
Greece, Italy, Netherlands, Portugal,
Russia, Spain, Switzerland</li>
</ul>
<p>Matches:</p>
<ul>
<li>64 matches – Groups stage (8x4): (Group A, Group B
Group C, Group D, Group E, Group F, Group G
Group H); Knockout stage: Round of 16,
Quarter-finals,
Semi-finals,
Third place match,
Final</li>
</ul>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="the-state-of-open-data---world-cup-in-brazil-2014">The State of Open Data - World Cup in Brazil 2014</h1>
<p>Q: Where can I get the teams, groups, match schedule (fixtures),
players, stadiums lets say in CSV, JSON or SQL?</p>
<p>Q: Where can I download lets say <code>world-cup-2014.db</code>?</p>
<p>Let’s search (google):</p>
<ul>
<li><a href="http://google.com/search?q=open+data+world+cup+brazil"><code>open data world cup brazil</code></a> or</li>
<li><a href="http://google.com/search?q=json+world+cup+brazil"><code>json world cup brazil</code></a></li>
</ul>
<p>Nothing. Nada. Nichts. Niente. Zilch. Zero.</p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="the-state-of-open-data---world-cup-in-brazil-2014-cont">The State of Open Data - World Cup in Brazil 2014 (Cont.)</h1>
<h3 id="official-fifa-site-fifacomworldcuphttpwwwfifacomworldcup">Official FIFA Site (<a href="http://www.fifa.com/worldcup"><code>fifa.com/worldcup</code></a>)</h3>
<p>=> No open data. Offers a booklet¹ (PDF) for download for match schedule.</p>
<p>¹) Single page, really w/ six FIFA Partners, eight FIFA World Cup Sponsors
and another six National Supporters.</p>
<h3 id="wikipedia-enwikipediaorgwiki2014fifaworldcuphttpenwikipediaorgwiki2014fifaworldcup">Wikipedia (<a href="http://en.wikipedia.org/wiki/2014_FIFA_World_Cup"><code>en.wikipedia.org/wiki/2014_FIFA_World_Cup</code></a>)</h3>
<p>Pro: Best source; open text license or public domain (license-free);
everything available for download (page dumps, etc).</p>
<p>Cons: Mostly free-form text, that is, no structured data and no web service. </p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="what-now-options">What now? Options</h1>
<p>1) Screen scrap FIFA site with web crawler? Why not?</p>
<p>2) Try to convert free-form text from Wikipedia into structured data? Why not?</p>
<p>3) Do-It-Yourself: Build a Wikipedia for structured data? Why not?</p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="do-it-yourself----lets-build-footballdb---open-football-data">Do-It-Yourself – Let’s Build <code>football.db</code> - Open Football Data</h1>
<p>Q: What Wiki Package to Use?</p>
<p>MediaWiki? Semantic MediaWiki? MoinMoin? DokuWiki? PeanutButterWiki? Any Others?</p>
<p>Q: What Source Format to Use?</p>
<p>XML, JSON, YAML, SEXPS (S-Expressions), RDF Triplets,
CSV (Comma-Separated Values), TOML (Tom’s Obvious, Minimal Language)? SQL? Any Others?</p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="do-it-yourself----githubcomopenfootball--cont">Do-It-Yourself – <code>github.com/openfootball</code> (Cont.)</h1>
<p>Q: What Wiki Package to Use?</p>
<p>A: Git (and GitHub)</p>
<p>Why Git?</p>
<ul>
<li>Distributed is the new centralized (everything is local, any workflow, many backups, and so on)</li>
<li>Free and open source; small and fast version tracker</li>
</ul>
<p>Learn more @ <a href="http://git-scm.com"><code>git-scm.com</code></a></p>
<p>Why GitHub?</p>
<ul>
<li>Build <del>software</del> data better, together. </li>
</ul>
<p>Learn more @ <a href="http://github.com"><code>github.com</code></a></p>
<p><img src="i/github-openfootball-worldcup.png" alt="" /></p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="do-it-yourself----what-is-csv-comma-separated-values">Do-It-Yourself – What is CSV (Comma-Separated Values)?</h1>
<p>Q: What Source Format to Use?</p>
<p>A: Keep it as simple as possible. Hand-crafted not machine-generated source.
Easy-to-read and easy-to-write.</p>
<p><del>XML</del>, <del>JSON</del>, <del>YAML</del>, <del>SEXPS (S-Expressions)</del>,
<del>RDF Triplets</del>, <del>SQL</del>,
<del>TOML (Tom’s Obvious, Minimal Language)</del>,
CSV (Comma-Separated Values)</p>
<p><code>teams.csv</code>:</p>
<pre><code>gre, Greece, GRE, gr
ned, Netherlands, NED, nl
ger, Germany, GER, de
por, Portugal, POR, pt
esp, Spain, ESP, es
ita, Italy, ITA, it
cro, Croatia, CRO, hr
eng, England, ENG, en
...
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="do-it-yourself-----whats-missing-in-csv-whats-csv-v2">Do-It-Yourself — What’s missing in CSV? What’s CSV v2?</h1>
<p>What’s missing?</p>
<ul>
<li>No comments</li>
<li>No blank lines</li>
<li>No multi-line records</li>
<li>No data types (or text patterns or field markers)</li>
<li>No unordered fields (that is, fields depend on position) or variable number of fields per record</li>
<li>No default/inherited values</li>
<li>And much more</li>
</ul>
<p>Let’s fix it. Welcome CSV v2 (<a href="https://github.com/csv2"><code>github.com/csv2</code></a>).</p>
<p><a href="https://github.com/openfootball/stadiums/blob/master/south-america/br-brazil--stadiums.txt"><code>south-america/br-brazil--stadiums.txt</code></a>:</p>
<pre><code>### Stadiums
[maracana]
Maracanã|Estádio do Maracanã, 1950
76_935
Rio de Janeiro, RJ
en.wikipedia: Estádio_do_Maracanã
[corinthians]
Corinthians|Arena Corinthians|Arena de São Paulo, 2014
68_000
São Paulo, SP
en.wikipedia: Arena_Corinthians
...
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="do-it-yourself----mini-language-for-football-fixtures">Do-It-Yourself – Mini Language for Football Fixtures</h1>
<p>DSL - Domain-Specific Language </p>
<p><a href="https://github.com/openfootball/world-cup/blob/master/2014/cup.txt"><code>world-cup/2014/cup.txt</code></a>:</p>
<pre><code>##################################
# World Cup 2014 Brazil
# -- Groups
Group A | Brazil Croatia Mexico Cameroon
Group B | Spain Netherlands Chile Australia
Group C | Colombia Greece Côte d'Ivoire Japan
Group D | Uruguay Costa Rica England Italy
Group E | Switzerland Ecuador France Honduras
Group F | Argentina Bosnia-Herzegovina Iran Nigeria
Group G | Germany Portugal Ghana United States
Group H | Belgium Algeria Russia South Korea
# -- Group A
Matchday 1 / Group A
(1) Thu Jun/12 17:00 Brazil - Croatia @ Arena de São Paulo, São Paulo (UTC-3)
Matchday 2 / Group A
(2) Fri Jun/13 13:00 Mexico - Cameroon @ Estádio das Dunas, Natal (UTC-3)
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="ruby-ruby-ruby----sportdb-ruby-gem">Ruby, Ruby, Ruby – <code>sportdb</code> Ruby Gem</h1>
<p>Import any fixtures:</p>
<ul>
<li>“Classic” Comma-separated values</li>
<li>“Modern” Comma-separated values v2</li>
<li>Mini language for football</li>
</ul>
<p>into any SQL database. Example:</p>
<p>Step 1: Get a copy of the data</p>
<pre><code>$ git clone git://github.com/openmundi/world.db.git
$ git clone git://github.com/openfootball/world-cup.git
</code></pre>
<p>Step 2: Let’s build the <code>world-cup-2014.db</code></p>
<pre><code>$ sportdb --dbname world-cup-2014.db setup --include ./world-cup --worldinclude ./world.db
</code></pre>
<p>That’s it.</p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-footballdb-in-ruby---models">How to use <code>football.db</code> in Ruby - Models</h1>
<p>Event Model</p>
<pre><code>ev = Event.find_by( key: 'world.2014' )
ev.title
=> 'World Cup 2014'
ev.teams.count
=> 32
ev.games.count
=> 64
ev.rounds.count
=> 20
ev.groups.count
=> 8
ev.stadiums.count
=> 12
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-footballdb-in-ruby---models-cont">How to use <code>football.db</code> in Ruby - Models (Cont.)</h1>
<p>Team Model</p>
<pre><code>bra = Team.find_by( key: 'bra' )
bra.title
=> 'Brazil'
bra.country.continent.title
=> 'South America'
bra.games.count
=> 3
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-footballdb-in-ruby---models-cont-1">How to use <code>football.db</code> in Ruby - Models (Cont.)</h1>
<p>Game Model</p>
<pre><code>g = Game.find_by( pos: 1 )
g.team1.title
=> 'Brazil'
g.team2.title
=> 'Croatia'
f.group.title
=> 'Group A'
f.round.title
=> 'Matchday 1'
f.stadium.title
=> 'Arena de São Paulo'
f.stadium.city.title
=> 'São Paulo'
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-footballdb-in-ruby---models-cont-2">How to use <code>football.db</code> in Ruby - Models (Cont.)</h1>
<p>More Models</p>
<ul>
<li>Round (e.g. Matchday 1, Round of 16, Final, etc.)</li>
<li>Group (e.g. Group A, Group B, etc.)</li>
<li>League (e.g. World Cup, World Cup Quali, World Confed, etc.)</li>
<li>Season (e.g. 2014, 2018, etc.)</li>
<li>Person a.k.a. Player (e.g. Lionel Messi, Neymar Jr, etc.)</li>
<li>Roster a.k.a. Team Squad (e.g. ARG-9 Lionel Messi, BRA-11 Neymar Jr, etc.)</li>
<li>Ground a.k.a. Stadium (e.g. Estádio do Maracanã)</li>
<li>And some more</li>
</ul>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-footballdb-with-http-jsonp-api">How to use <code>football.db</code> with HTTP JSON(P) API</h1>
<pre><code>$ sportdb serve
</code></pre>
<p>Use the <code>football.db</code> HTTP JSON(P) API - Examples</p>
<p>List all teams for an event (league+season) <code>/event/:key/teams</code></p>
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>/event/world.2014/teams</code></td>
<td>World Cup 2014</td>
</tr>
</tbody>
</table>
</li>
<li>
<table>
<tbody>
<tr>
<td><code>/event/de.2013_14/teams</code></td>
<td>Deutsche Bundesliga 2013/14</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p>List all rounds for an event (league+season) <code>/event/:key/rounds</code></p>
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>/event/world.2014/rounds</code></td>
<td>World Cup 2014</td>
</tr>
</tbody>
</table>
</li>
<li>
<table>
<tbody>
<tr>
<td><code>/event/de.2013_14/rounds</code></td>
<td>Deutsche Bundesliga 2013/14</td>
</tr>
</tbody>
</table>
</li>
</ul>
<p>List all games in a round for an event (league+season) <code>/event/:key/round/:pos</code></p>
<ul>
<li>
<table>
<tbody>
<tr>
<td><code>/event/world.2014/round/20</code></td>
<td>World Cup 2014 - 20th Round (=> Final)</td>
</tr>
</tbody>
</table>
</li>
<li>
<table>
<tbody>
<tr>
<td><code>/event/de.2013_14/round/5</code></td>
<td>Deutsche Bundesliga 2013/14 - 5th Round</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-http-json-api---get-eventworld2014teams">How to use HTTP JSON API - <code>GET /event/world.2014/teams</code></h1>
<p>List all teams for an event <code>/event/:key/teams</code></p>
<pre><code>GET /event/world.2014/teams
{
"event": {
"key": "world.2014",
"title": "World Cup 2014"
},
"teams": [
{ "key": "gre", "title": "Greece", "code": "GRE" },
{ "key": "rus", "title": "Russia", "code": "RUS" },
{ "key": "ned", "title": "Netherlands", "code": "NED" },
{ "key": "ger", "title": "Germany", "code": "GER" },
{ "key": "por", "title": "Portugal","code": "POR" },
...
]
}
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="how-to-use-http-json-api-cont---get-eventworld2014round1">How to use HTTP JSON API (Cont.) - <code>GET /event/world.2014/round/1</code></h1>
<p>List all games in a round for an event <code>/event/:key/round/:pos</code></p>
<pre><code>GET /event/world.2014/round/1
{
"event": { "key": "world.2014", "title": "World Cup 2014" },
"round": { "pos": 1, "title": "Matchday 1" },
"games": [
{
"team1_key": "bra",
"team1_title": "Brazil",
"team1_code": "BRA",
"team2_key": "cro",
"team2_title": "Croatia",
"team2_code": "CRO",
"play_at": "2014/06/12",
"score1": null,
"score2": null,
"score1ot": null,
"score2ot": null,
"score1p": null,
"score2p": null
}
]
}
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="more-goodies---examples-web-apps-and-books">More Goodies - Examples Web Apps and Books</h1>
<p>Any Example Web Apps?</p>
<ul>
<li><code>sport.db.admim</code> - Open Source Rails Engine; see <a href="https://github.com/geraldb/sport.db.admin"><code>github.com/geraldb/sport.db.admin</code></a></li>
</ul>
<p><img src="i/sport-db-admin.png" alt="" /></p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="more-goodies---examples-web-apps-and-books-cont">More Goodies - Examples Web Apps and Books (Cont.)</h1>
<p>Any Example Web Apps?</p>
<ul>
<li>Sportbook - Football Betting (Prediction, Picks) Pool Manager; Open Source Rails Web App; see <a href="https://github.com/openbookie"><code>github.com/openbookie</code></a></li>
</ul>
<p><img src="i/sportbook.png" alt="" /></p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="more-goodies---examples-web-apps-and-books-cont-1">More Goodies - Examples Web Apps and Books (Cont.)</h1>
<p>Any Example Web Apps?</p>
<ul>
<li><code>football.js</code> - Open Source JavaScript Matchday Widget - still early stage; see <a href="https://github.com/geraldb/football.js"><code>github.com/geraldb/football.js</code></a></li>
<li>The Free World Football Almanac - Free public domain e-book - still early stage; see <a href="https://github.com/openfootball/book"><code>github.com/openfootball/book</code></a></li>
</ul>
<p>Anything Else?</p>
<ul>
<li>Your App Here; Be Bold</li>
</ul>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="thats-it-thank-you">That’s it. Thank you.</h1>
<h3 id="links">Links</h3>
<ul>
<li><a href="https://github.com/openfootball">github.com/openfootball</a></li>
</ul>
<p>More Open Data Projects</p>
<ul>
<li><a href="https://github.com/openbeer">github.com/openbeer</a></li>
<li><a href="https://github.com/openwine">github.com/openwine</a></li>
<li><a href="https://github.com/openmundi">github.com/openmundi</a></li>
</ul>
<h3 id="questions-comments">Questions? Comments?</h3>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="bonus-license----what-is-public-domain--why-public-domain">Bonus: License – What is Public Domain? Why Public Domain?</h1>
<h2 id="license">License</h2>
<p>The <code>football.db</code> schema, data and scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.</p>
<h2 id="what">What?</h2>
<p>No Copyright. No License. Creative Commons Zero (CC0). Unlicense. </p>
<h2 id="why">Why?</h2>
<p>Keep it simple. </p>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="bonus--beer-wine-alpine-ski-formula-1">Bonus: Beer? Wine? Alpine Ski? Formula 1?</h1>
<h2 id="whats-beerdb">What’s <code>beer.db</code>?</h2>
<p>A free open public domain beer database n schema
for use in any (programming) language
(e.g. uses plain text fixtures/data sets). Example:</p>
<pre><code>### Brewery
guinness, St. James's Gate Brewery / Guinness Brewery, 1759, Dublin
</code></pre>
<pre><code>### Beer
Guinness|Guinness Draught, 4.2%, irish_dry_stout|dry_stout|stout
</code></pre>
</div>
<div class='slide '>
<!-- _S9SLIDE_ -->
<h1 id="bonus-how-to-use-http-json-api---get-beerguinness">Bonus: How to use HTTP JSON API - <code>GET /beer/guinness</code></h1>
<p>Get beer by key <code>/beer/:key</code></p>
<pre><code>GET /beer/guinness
{
"beer":
{
"key":"guinness",
"title":"Guinness",
"synonyms": "Guinness Draught",
"abv":"4.2",
"srm":null,
"og":null,
"tags":["irish_dry_stout","dry_stout","stout"],
"brewery":
{
"key": "guinness",
"title": "St. James's Gate Brewery / Guinness Brewery"
},
"country":
{
"key":"ie",
"title":"Irland"
}
}
}
</code></pre>
<!-- === end markdown block === -->
</div>
</div> <!-- presentation -->
</body>
</html>