The ORI has a number of scripts for interacting with the data.
These ones were developed as part of some AJAXie data-sanity web pages, but may be of general interest.
Other example uses of the ORI APIs are the main API and example_list.html
These three examples use a local script to access the actual get_* scripts on the remote server. They are not making a cross domain call.
These three examples use features of JQuery to access the actual get_* scripts on the remote server. They are making a cross domain calls.
The code for the local script that makes the remote call is:
#!/usr/bin/perl
use LWP::Simple qw(get);
## NOTE: DEVEL SERVER - NOT A GUARENTEED SERVICE
my $host = 'http://devel.edina.ac.uk:1201/cgi';
# we need the send an initial content-type
print "Content-type: text/html\n\n";
my $p = $ENV{PATH_INFO};
$p =~ s#^/##; # using '#' as delimiter
my @q = split /\&/, $ENV{QUERY_STRING};
my %q;
foreach my $i (@q) {
my ( $a, $b ) = split /=/, $i;
$q{$a} = $b;
}
my $url;
if ($p =~ /org/) {
$url = "$host/get_orgs5?format=json&field=name&q=" . $q{q};
warn "url:$url\n";
print get($url);
};
if ($p =~ /net/ ) {
$url = "$host/get_nets5?format=json&field=ip&q=" . $q{q};
warn "url:$url\n";
print get($url);
};
if ($p =~ /repo/ ) {
$url = "$host/get_repos5?format=json&field=url&q=" . $q{q};
warn "url:$url\n";
print get($url);
};
These three examples are making a cross domain calls.