Class: WeixinSyncer
- Inherits:
-
PerNodeSyncer
- Object
- AbstractSyncer
- PerNodeSyncer
- WeixinSyncer
- Defined in:
- lib/syncers/weixin_syncer.rb
Constant Summary
Constants included from NodeAttrModule
Instance Method Summary collapse
Methods inherited from PerNodeSyncer
Methods included from NodeAttrModule
Methods inherited from AbstractSyncer
#_fetch_html, #gen_html, #get_article_nodes, #initialize
Constructor Details
This class inherits a constructor from AbstractSyncer
Instance Method Details
#_handle_node(node) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/syncers/weixin_syncer.rb', line 10 def _handle_node(node) node.children.each do |child_node| case child_node.name when 'img' child_node['src'] = child_node['data-src'] child_node['data-src'] = nil end end node.to_html end |
#get_article_xpath ⇒ Object
6 7 8 |
# File 'lib/syncers/weixin_syncer.rb', line 6 def get_article_xpath '//div[contains(@class, "rich_media_content") and contains(@id, "js_content")]' end |