Skip to content

Commit

Permalink
bug fix for empty price
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitweinvest committed Sep 15, 2017
1 parent 3e5e0ce commit 53c42e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/coinmarketcap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.get_historical_price(id, start_date, end_date) #20170908
prices = []
doc = Nokogiri::HTML(open("https://coinmarketcap.com/currencies/#{id}/historical-data/?start=#{start_date}&end=#{end_date}"))
rows = doc.css('tr')
if rows.count == 31
if rows.count == 31 || rows.count == 2
doc = Nokogiri::HTML(open("https://coinmarketcap.com/assets/#{id}/historical-data/?start=#{start_date}&end=#{end_date}"))
rows = doc.css('tr')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/coinmarketcap/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Coinmarketcap
VERSION = "0.2.2"
VERSION = "0.2.3"
end

0 comments on commit 53c42e4

Please sign in to comment.