Permalink
Browse files

Merge branch 'master' into gh-pages

  • Loading branch information...
2 parents ee8e94a + d48bf09 commit 87e611d3902c382343359a3d5776eb0d5729e849 @ryanfb committed Jun 3, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 associations.rb
View
@@ -30,6 +30,15 @@ def is_403?(uri)
doc.xpath('//a[contains(@href,"books.google.com") or contains(@href,"www.archive.org")]').each do |link|
loeb = link.xpath('preceding::a[contains(@href,"hup.harvard.edu")][2]').first
title = loeb.xpath('following::td[1]').first.content
+ original_title = loeb.xpath('following::td[1]/following::i[1]').first.content
+
+ author = title.split(' -- ').first
+ if author =~ /,/
+ title = original_title
+ else
+ title = author + ' -- ' + original_title
+ end
+
loeb = loeb.content
unless is_403?("http://s3.amazonaws.com/loebolus/#{loeb}.pdf")

0 comments on commit 87e611d

Please sign in to comment.