Skip to content

Commit

Permalink
Update fetch new symbol service
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-xiong committed Mar 4, 2024
1 parent cebe855 commit ddf1a2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/fetch_new_symbol_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def execute
redis_key = 'binance_announcement_fetch_time'
last_fetch_time = $redis.get(redis_key).to_i
page = Nokogiri::HTML(URI.open(BASE_URL), nil, 'UTF-8')
data = JSON.parse(page.css("script").children[13])
catalog = data['appState']['loader']['dataByRouteId']['2a3f']['catalogs'].select{|c| c['catalogName'] == '数字货币及交易对上新'}.first rescue nil
data = JSON.parse(page.css("script").children[15])
catalog = data['appState']['loader']['dataByRouteId']['d969']['catalogs'].select{|c| c['catalogName'] == '数字货币及交易对上新'}.first rescue nil
return if catalog.nil?

$redis.set(redis_key, Time.current.to_i * 1000)
Expand Down

0 comments on commit ddf1a2a

Please sign in to comment.