class PerNodeSyncer

Public Instance Methods

gen_html() click to toggle source
# File lib/syncers/per_node_syncer.rb, line 23
def gen_html
  article_nodes = self.get_article_nodes
  content = []
  article_nodes.each do |node|
    NodeAttrModule.remove_common_attr(node)
    content.append self._handle_node(node)
  end

  content.join("\n")
end
get_article_nodes() click to toggle source
# File lib/syncers/per_node_syncer.rb, line 17
def get_article_nodes
  page_html = self._fetch_html
  article = Nokogiri::HTML(page_html).xpath(self.get_article_xpath)
  article.children
end