_ext/jboss_developer.rb
# Private: Parses the sitemap and stores it in the @drupal_pages
#
# response - A Faraday::Response object
Parses the sitemap and stores it in the @drupal_pages
response - A Faraday::Response object
Parses the sitemap and stores it in the @drupal_pages response - A Faraday :: Response object
def parse_sitemap(response)
        sitemap_xml = Nokogiri::XML(response.body)
        @drupal_pages = {}
        sitemap_xml.xpath('//ns:url', {'ns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'}).each do |url|
          loc = url.element_children.find{|k| k.name == 'loc'}.text
          mod_time = nil
          lastmod_elm = url.element_children.find{|k| k.name == 'lastmod'}
          if lastmod_elm
            mod_time = DateTime.parse lastmod_elm.text
          end
          @drupal_pages[URI.parse(loc).path] = mod_time
        end
      end
def parse_sitemap ( response ) sitemap_xml = Nokogiri :: XML ( response . body ) @drupal_pages = { } sitemap_xml . xpath ( '//ns:url' , { 'ns' => 'http://www.sitemaps.org/schemas/sitemap/0.9' } ) . each do | url | loc = url . element_children . find { | k | k . name == 'loc' } . text mod_time = nil lastmod_elm = url . element_children . find { | k | k . name == 'lastmod' } if lastmod_elm mod_time = DateTime . parse lastmod_elm . text end @drupal_pages [ URI . parse ( loc ) . path ] = mod_time end end
Private: Parses the sitemap and stores it in the @drupal_pages
response - A Faraday::Response object
Private : Parses the sitemap and stores it in the @drupal_pages response - A Faraday :: Response object
response
<not_specific>