Permalink
Browse files

Sleeping consistently.

  • Loading branch information...
jqr committed Apr 5, 2012
1 parent fd4e559 commit e754fc5af7d5327098d52bedb46500e3703d014c
Showing with 5 additions and 7 deletions.
  1. +5 −7 runkeeper.rb
View
@@ -172,18 +172,16 @@ def find_and_parse_cached_activity_page
def open_url_and_cache_activity_page
puts " Downloading the activity on #{path}"
+ # Be a good Net citizen and wait 1 second so we don't pound
+ # their web site repeatedly
+ sleep 1
+
raw_html = open(url).read
# Cache the raw HTML
self.class.cache_file(cache_file_name, raw_html)
- doc = Nokogiri::HTML(raw_html)
-
- # Be a good Net citizen and wait 1 second so we don't pound
- # their web site repeatedly
- sleep 1
-
- doc
+ Nokogiri::HTML(raw_html)
end
# Get the url for a single user's activities

0 comments on commit e754fc5

Please sign in to comment.