lib/opds/support/browser.rb
# extracts linkset from doc + xpath expression
extracts linkset from doc + xpath expression
extracts linkset from doc + xpath expression
def extract_links(tab,doc, expr)
				doc.xpath(expr).each do |n|
					text=nil
					text=n.attributes['title'].value unless n.attributes['title'].nil?
					if n.name=='a' && text.nil?
						text=n.text
					end
					link=n.attributes['href'].value
					type=n.attributes['type'].value unless n.attributes['type'].nil?
					unless n.attributes['rel'].nil?
						n.attributes['rel'].value.split.each do |rel|
							tab.push(rel,link,text,type)
						end
					else
						tab.push(nil,link,text,type)
					end
				end
				tab
			end
def extract_links ( tab , doc , expr ) doc . xpath ( expr ) . each do | n | text = nil text = n . attributes [ 'title' ] . value unless n . attributes [ 'title' ] . nil? if n . name == 'a' && text . nil? text = n . text end link = n . attributes [ 'href' ] . value type = n . attributes [ 'type' ] . value unless n . attributes [ 'type' ] . nil? unless n . attributes [ 'rel' ] . nil? n . attributes [ 'rel' ] . value . split . each do | rel | tab . push ( rel , link , text , type ) end else tab . push ( nil , link , text , type ) end end tab end
extracts linkset from doc + xpath expression
extracts linkset from doc + xpath expression
tab
<not_specific>
doc
<not_specific>
expr
<not_specific>