Module: Commuter::Mapper
- Defined in:
- lib/commuter/mapper.rb
Class Method Summary collapse
Class Method Details
.map(start, dest) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/commuter/mapper.rb', line 7 def self::map(start, dest) map_url = "http://maps.google.com/maps?saddr=#{start}&daddr=#{dest}" agent = Mechanize.new page = agent.get(map_url) times = [] page.search("div.altroute-info span:last-child").each do |span| times << span.inner_html end times end |