Any search result can be pulled as json, jsonP, XML, YAML, iCalendar and RSS. See the examples below.
We also provide a REST API.
http://wikical.com/events/?query=@berlin&view=xml
<html>
<head>
<meta charset="utf-8"/>
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
</head>
<body>
<script>
jQuery(document).ready( function($) {
var description = "Upcoming events in Berlin";
var query = encodeURIComponent("@berlin");
$('#wikical').append(
'<h3><a href="https://wikical.com/events/?query='+query+'">'+description+'</h3>'
);
$.getJSON('https://wikical.com/events/?query='+query+'&view=json&jsonp=?', function(data) {
$.each(data, function(nr,evento) {
var datefields = evento.upcoming.split('-');
$('#wikical').append(
'<div class="wikical-event">'+
' <div class="wikical-date">Upcoming: '+
(datefields[2]*1)+'.'+(datefields[1]*1)+'.'+datefields[0]+
' </div>'+
' <div class="wikical-title">'+
'<a href="http://wikical.com/'+evento.id+'/">'+evento.title+'</a>'+
' </div>'+
'</div>'
);
});
});
});
</script>
<div id="wikical">
</div>
</body>
</html>
#!/usr/bin/perl
use strict;
use JSON;
use LWP::Simple;
my $url = 'http://wikical.com/events/?query=%40berlin&view=json';
my $content = get $url;
my $json = JSON->new->allow_nonref;
my $data = $json->decode( $content);
for my $event (@{$data})
{
for my $k (keys %{$event})
{
print "$k:";
if($k eq "fields")
{
print "\n";
for my $subk (keys %{$event->{$k}})
{
print "\t$subk: $event->{$k}{$subk}\n";
}
}
else
{
print " $event->{$k}\n";
}
}
}
print "\n";
<html>
<body>
<?php
$url = "http://wikical.com/events/?query=%40berlin&view=json";
$json = file_get_contents($url);
//var_dump(json_decode($json, true));
$array = json_decode($json, true);
print "<pre>\n";
foreach ($array as $number => $value) {
$fields = $value['fields'] ;
print $fields['upcoming'].' '.$fields['title']."\n";
}
print "</pre>\n";
?>
</body>
</html>