#!/usr/bin/perl -w

use strict;
use XML::Simple;
use LWP::UserAgent;

# change the key and parameters following our documentation - http://www.spock.com/api
my $url = 'http://www.spock.com/api/2/search.xml?api_key=115c5ab1fb7dec3a8ce457fee8e6f0eb&query=spock-team&show_blurb=1&sig=3462c6f4692d6977bd8f734c6584b42b';
my $xml = XMLin(LWP::UserAgent->new->get($url)->content);

while ((my $name, my $info) = each %{$xml->{search_results}->{person}}) {
	(my $blurb = $info->{blurb}) =~ s/^\s+|\s+$//g;
	$blurb = '<empty blurb>' if ref($blurb) eq "HASH";
	print '-'x30 ."\n   $name\n".'-'x30 ."\n$blurb\n\n";
}
