| 1 | # $Id: Science.pm,v 1.2 2007-01-26 13:53:48 mike Exp $ | ||
| 2 | |||
| 3 | package Keystone::Resolver::plugins::Service::Science; | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | |||
| 9 | # The problem with _Science_ magazine is that its URLs include issue | ||
| 10 | # numbers, but these are typically omitted from citations -- and in | ||
| 11 | # particular from all the example OpenURLs in the standard. So we | ||
| 12 | # need to figure out the issue number where possible. | ||
| 13 | # | ||
| 14 | # There has to be a better way than this: I'm sure the other resolvers | ||
| 15 | # don't all have special-case code for this citation (do they?) Does | ||
| 16 | # _Science_ provide another access-URL option? | ||
| 17 | |||
| 18 | sub uri { | ||
| 19 | my $class = shift(); | ||
| 20 | my($openurl) = @_; | ||
| 21 | |||
| 22 | my($volume, $issue, $spage) | ||
| 23 | = map { $openurl->rft($_) } qw(volume issue spage); | ||
| 24 | |||
| 25 | if (!defined $issue) { | ||
| 26 | if ($volume == 275 && $spage == 1320) { | ||
| 27 | # It's the Bergelson article from all the examples | ||
| 28 | $issue = 5304; | ||
| 29 | } else { | ||
| 30 | return (undef, "can't guess issue number from metadata"); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | my $dir = "full"; | ||
| 35 | $dir = "abstract" | ||
| 36 | if $class eq "Keystone::Resolver::plugins::Service::ScienceAbstracts"; | ||
| 37 | return "http://www.sciencemag.org/cgi/content/$dir/$volume/$issue/$spage"; | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | 1; |