Class: HPL

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/HPL.rb

Class Method Summary collapse

Class Method Details

.nameObject



21
22
23
# File 'lib/plugins/HPL.rb', line 21

def self.name
  "Houston Public Library"
end

.parse(html) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/plugins/HPL.rb', line 7

def self.parse(html)
  xml = Nokogiri::XML.parse(html)
  xml.css('.bibItemsEntry').collect do |table|
    due = ''
    row = table.css('td')
    status = row[3].text.strip
    if status =~ /DUE/
      due = status[4, 8]
      status = "Checked out"
    end
    HoustonLibrarySearch::Listing.new(row[0].text.strip, row[2].text.strip, status.capitalize, due)
  end
end

.url(isbn) ⇒ Object



3
4
5
# File 'lib/plugins/HPL.rb', line 3

def self.url(isbn)
  "http://catalog.houstonlibrary.org/search~S0/?searchtype=i&searcharg=#{isbn}"
end