Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
zaimramlan committed Apr 7, 2019
2 parents 5d2351d + 8ce2fbc commit 716db3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Malaysia prayer times (waktu solat) JSON API @ E-Solat API. Data from [JAKIM's E

## Changelogs

**v1.2.3 - 07/04/2019**
- Resolve minor issue

**v1.2.2 - 06/04/2019**
- Resolve minor issue

Expand Down
12 changes: 11 additions & 1 deletion lib/tasks/esolat/v2/scrapezones.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace :esolat do
hash = Hash.new

url = ENV['MAIN_ZONE_URL']
page = Nokogiri::HTML(open(url))
page = perform_open(url)

# retrieve the zone codes
rows = page.css('optgroup').to_a
Expand All @@ -40,5 +40,15 @@ namespace :esolat do
RecordsHelper.create_zones_from(hash)
puts '================= SCRAPING FINISHED =================='
end

def perform_open(url)
begin
page = Nokogiri::HTML(open(url))
rescue
page = perform_open(url)
end

return page
end
end
end

0 comments on commit 716db3c

Please sign in to comment.