Permalink
Browse files

implement Author->books

  • Loading branch information...
1 parent 137b020 commit 73c9d263d75b4a91e1678e092f82174ffb72e4ce @moritz committed Jun 21, 2011
Showing with 6 additions and 1 deletion.
  1. +2 −1 lib/WebService/Libris.pm
  2. +4 −0 lib/WebService/Libris/Author.pm
View
3 lib/WebService/Libris.pm
@@ -306,7 +306,8 @@ sub collection_from_dom {
my %seen;
$self->dom->find($search_for)->each(sub {
my $d = shift;
- my $resource_url = $d->attrs->{'rdf:resource'};
+ my $resource_url = $d->attrs->{'rdf:resource'}
+ // $d->attrs->{'rdf:about'};
return unless $resource_url;
my ($k, $id) = $self->fragment_from_resource_url($resource_url);
next if $seen{$id}++;
View
4 lib/WebService/Libris/Author.pm
@@ -37,4 +37,8 @@ sub names {
map $_->text, shift->_description->find('name')->each;
}
+sub books {
+ shift->collection_from_dom('description[about^="http://libris.kb.se/resource/bib/"]');
+}
+
1;

0 comments on commit 73c9d26

Please sign in to comment.