Permalink
Browse files

Strip out weird non-standard characters

  • Loading branch information...
1 parent 9fdd521 commit aa5a5d3c60819f1c8e904899d25c8212b0527442 @chendo committed Dec 7, 2011
Showing with 1 addition and 3 deletions.
  1. +0 −2 lib/metlinkr.rb
  2. +1 −1 lib/metlinkr/step.rb
View
@@ -36,8 +36,6 @@ def route(from, to, options = {})
body = results.body
- match = body.match(%r|<tr class="p4">(.*?)</tr>|)
-
doc = Nokogiri::HTML(body)
link = doc.search('tr.p4 td.dontprint a').first
View
@@ -67,7 +67,7 @@ def parse_duration
end
def clean_stop_name(stop)
- stop.gsub(/^(From Stop)|(Get off at( stop)?)|(To)\b/i, '').gsub(/(\d+)-/, 'Stop \1 - ').strip
+ stop.gsub(/^(From Stop)|(Get off at( stop)?)|(To)\b/i, '').gsub(/(\d+)-/, 'Stop \1 - ').gsub(/[^ -z]+/, ' ').strip
end
def clean_time(time)

0 comments on commit aa5a5d3

Please sign in to comment.