Permalink
Browse files

Get URLs for Judgment and Decision Making, since there are no DOIs.

  • Loading branch information...
1 parent e45db26 commit 2f743e88a0c527bb43e7936737b5e39c49554108 @Kodiologist committed May 4, 2012
Showing with 33 additions and 6 deletions.
  1. +30 −6 Perl/Citematic/Get.pm
  2. +3 −0 Perl/test_citematic.pl
View
36 Perl/Citematic/Get.pm
@@ -246,7 +246,7 @@ sub citation
sub journal_article
{my ($authors, $year, $article_title, $journal, $volume, $issue,
- $first_page, $last_page, $doi) = @_;
+ $first_page, $last_page, $doi, $url) = @_;
citation
type => 'article-journal',
author => $authors,
@@ -256,7 +256,8 @@ sub journal_article
volume => $volume,
issue => $issue,
page => digest_pages($first_page, $last_page),
- DOI => $doi;}
+ DOI => $doi,
+ URL => $url;}
sub book_chapter
{my ($authors, $year, $chapter_title, $editors, $book, $volume,
@@ -460,7 +461,7 @@ sub ebsco
return journal_article $authors, $d{year},
$title, $d{journal_title},
$d{volume}, $d{issue}, $d{first_page} || $1, $d{last_page} || $2,
- $record{'Digital Object Identifier'};}
+ $record{'Digital Object Identifier'}, undef;}
my $year;
if ($record{Source} =~ s{,?\s+\d{1,2}/\d{1,2}/(\d{4})}{})
{$year = $1;}
@@ -517,9 +518,14 @@ sub ebsco
get_doi
$year, $journal, $title,
$authors->[0]{family}, $volume, $fpage;
+ my $url;
+ lc($journal) eq 'judgment and decision making'
+ # This is an open-access journal, but it doesn't have
+ # DOIs, so get a URL.
+ and $url = sjdm_url_from_title($title);
return journal_article $authors, $year, $title,
- $journal, $volume, $issue, $fpage, $lpage, $doi;}
+ $journal, $volume, $issue, $fpage, $lpage, $doi, $url;}
elsif ($record{'Document Type'} eq 'Chapter')
@@ -548,7 +554,7 @@ sub ebsco
$authors->[0]{family}, $volume, $src{fpage};
return journal_article $authors, $src{year}, $title,
'Annals of the New York Academy of Sciences',
- $volume, undef, $src{fpage}, $src{lpage}, $doi;}
+ $volume, undef, $src{fpage}, $src{lpage}, $doi, undef;}
(my $book = $src{book}) =~ s/: /: /;
$src{volume} and $book =~ s/, Vol\z//;
@@ -646,7 +652,25 @@ sub ideas
return journal_article
$authors, $record{year}, $record{title},
$journal, $record{volume}, $record{issue},
- $fpage, $lpage, $doi;}
+ $fpage, $lpage, $doi, undef;}
+
+# ------------------------------------------------------------
+# Society for Judgment and Decision-Making
+# ------------------------------------------------------------
+
+sub sjdm_url_from_title
+ {my $title = shift;
+ progress 'Trying SJDM';
+ $global_cache->{sjdm}{lc($title)} ||= do
+ {my $page = LWP::Simple::get(query_url
+ 'http://www.sjdm.org/cgi-bin/namazu.cgi',
+ max => 10, result => 'normal', sort => 'score',
+ idxname => 'journal',
+ query => "{$title}");
+ # Curly braces signify an exact match in Namazu.
+ # (http://www.namazu.org/doc/manual.html#query-phrase)
+ $page =~ m/<dd><a href="(.+?)">/ or return err 'No results.';
+ $1;}}
# ------------------------------------------------------------
# Public interface
View
3 Perl/test_citematic.pl
@@ -95,6 +95,9 @@ sub apa
is apa(year => 2006, author => ['ditto', 'pizarro']),
'Ditto, P. H., Pizarro, D. A., Epstein, E. B., Jacobson, J. A., & MacDonald, T. K. (2006). Visceral influences on risk-taking behavior. <i>Journal of Behavioral Decision Making, 19</i>(2), 99–113. doi:10.1002/bdm.520',
'Journal of Behavioral Decision Making (miscapitalized title)';
+is apa(year => 2007, author => ['levin', 'pederson']),
+ 'Levin, I. P., Weller, J. A., Pederson, A. A., & Harshman, L. A. (2007). Age-related differences in adaptive decision making: Sensitivity to expected value in risky choice. <i>Judgment and Decision Making, 2</i>(4), 225–233. Retrieved from http://journal.sjdm.org/7404/jdm7404.htm',
+ 'Judgment and Decision Making';
is apa(title => ['short-term memory', 'we stand']),
'Crowder, R. G. (1993). Short-term memory: Where do we stand? <i>Memory & Cognition, 21</i>(2), 142–145. doi:10.3758/BF03202725',
'Memory & Cognition (title search, ampersand in journal title)';

0 comments on commit 2f743e8

Please sign in to comment.