Browse Source

Update

* rename to #ShowtimesTH
* backend is http://showtimes.everyday.in.th/
* add API page
master
sipp11 10 years ago
parent
commit
f31438afa9
  1. 57
      index.html
  2. 12
      js/app.js

57
index.html

@ -14,6 +14,7 @@
<a class="brand">{{appName}}</a>
<ul class="nav">
<li>{{#link-to 'groups'}}Theaters{{/link-to}}</li>
<li>{{#link-to 'api'}}API{{/link-to}}</a></li>
<li>{{#link-to 'about'}}About{{/link-to}}</a></li>
</ul>
</div>
@ -91,16 +92,70 @@
<p>{{showtimes}} {{#if cinema}}<small class='muted'>#{{cinema}}</small>{{/if}}</p>
</td>
</tr>
{{else}}
<tr>
<td>
Try checking out again after 7 in the morning since data will be processed around that time. Nope SF/Major-group does not update that frequent. I could not do a thing about it.
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script type="text/x-handlebars" id="api">
<div class='about'>
<h1>#ShowtimesTH Public API</h1>
<p>While this is in BETA, there will be no key or whatever. Data should be self explanation and is updating daily, roughly 7am ICT.</p>
<p>Information provided is based on the sources, SF/Major's web site.</p>
<p>So far, data is in JSON format only. Please refer back to us if you use it.</p>
<table class="table">
<thead>
<tr>
<th>What</th>
<th>Detail <small class="muted">application/json response</small></th>
</tr>
</head>
<tbody>
<tr>
<td>Groups</td>
<td>
get an array of theaters' groups
<br/><br/>
<pre>GET http://showtimes.everyday.in.th/api/groups/</pre>
</td>
</tr>
<tr>
<td>Theaters</td>
<td>
get a list of theaters
<br/><br/>
<pre>GET http://showtimes.everyday.in.th/api/theaters/</pre>
<pre>GET http://showtimes.everyday.in.th/api/theaters/&lt;group&gt;/</pre>
</td>
</tr>
<tr>
<td>Showtimes</td>
<td>
get a list of showtimes; return all showtimes if no date specified.
<br/><br/>
<pre>GET http://showtimes.everyday.in.th/api/showtimes/&lt;group&gt;/</pre>
<pre>GET http://showtimes.everyday.in.th/api/showtimes/&lt;group&gt;/&lt;theater_code&gt;/</pre>
<pre>GET http://showtimes.everyday.in.th/api/showtimes/&lt;group&gt;/&lt;theater_code&gt;/?d=YYYY-MM-DD</pre>
</td>
</tr>
</body>
</table>
</div>
</script>
<script type="text/x-handlebars" id="about">
<div class='about'>
<h1>Zzyzx</h1>
<p>Whatever it is, it's quite awesome.</p>
<p>Whatever it is, it's quite awesome. Talk with us <a href="http://zzyzx.pw/">@Zzyzx Forum</a></p>
</div>
</script>

12
js/app.js

@ -3,11 +3,18 @@ App = Ember.Application.create();
App.ApplicationRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('title', "Hello World");
},
});
// redirect '/' to 'groups' by default
App.IndexRoute = Ember.Route.extend({
beforeModel: function() {
this.transitionTo('groups');
}
});
App.ApplicationController = Ember.Controller.extend({
appName: 'Showtimes'
appName: '#ShowtimesTH'
});
var groups = [
@ -24,12 +31,13 @@ var showtimes = [
{id: "2", name: "The Notebook (2004)", showtimes: ['15:30', '17:30']},
];
var restUrl = 'http://localhost:8888';
var restUrl = 'http://showtimes.everyday.in.th/api';
var today = new Date();
App.Router.map(function() {
this.resource('about');
this.resource('api');
this.resource('groups', {path: '/g'}, function() {
this.resource('theaters', {path: ':name'}, function() {
this.resource('showtimes', {path: ':code'});

Loading…
Cancel
Save