Class: Shortwave::Facade::Build::DocumentationRemote

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/shortwave/facade/build/facade_builder.rb

Overview

A remote facade for the Last FM html documentation

Class Method Summary collapse

Class Method Details

.scrape_remote_method_indexObject



50
51
52
53
54
55
56
57
58
59
# File 'lib/shortwave/facade/build/facade_builder.rb', line 50

def self.scrape_remote_method_index
  html = get("/api/intro")
  Nokogiri::HTML(html).css(REMOTE_CLASS).inject({}) do |hsh, node|
    hsh[node.text] = node.next.next.css("a").inject({}) do |h, anchor|
      h[anchor.text] = anchor["href"]
      h
    end
    hsh
  end
end