Class: Evernicious::BookmarksParser

Inherits:
Object
  • Object
show all
Defined in:
lib/evernicious/bookmarks_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse(bookmarks_code_source) ⇒ Object



3
4
5
6
7
# File 'lib/evernicious/bookmarks_parser.rb', line 3

def parse(bookmarks_code_source)
  document = Nokogiri::HTML(bookmarks_code_source, nil, 'UTF-8')
  #Delicious HTML format has unclosed tags and presents problems with nokogiri. See XPath expression at http://goo.gl/Cm7Zn
  build_bookmars document.xpath('//dt/a | //dt[a]/following-sibling::*[1][self::dd]')
end