use Encode;
use iCal::Parser;
+plugin 'proxy';
+
get '/reservations/get/(*url)' => sub {
my $self = shift;
}
}
+ @events = map {
+ foreach my $check_slot ( qw(
+ DESCRIPTION
+ LOCATION
+ STATUS
+ SUMMARY
+ )) {
+ next unless exists $_->{$check_slot};
+ $_->{slots} = $1 if $_->{$check_slot} =~ m/(\d+)\s*mjesta/s;
+ }
+ $_;
+ } @events;
+
$ical->{events} = [ sort {
$a->{DTSTART} cmp $b->{DTSTART}
} @events ];
_render_jsonp( $self, $hash );
};
+get '/_utils/script/(*url)' => sub { $_[0]->proxy_to( "$couchdb/_utils/script/" . $_[0]->param('url') , with_query_params => 1 ) };
+
app->start;
__DATA__