From d0639afa6363f42447e61e5f25a89db20c1f8cc6 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Sun, 27 May 2018 03:38:28 -0700 Subject: [PATCH] fix popular search service --- app/logical/popular_search_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/logical/popular_search_service.rb b/app/logical/popular_search_service.rb index 881d12e09..a70b11d58 100644 --- a/app/logical/popular_search_service.rb +++ b/app/logical/popular_search_service.rb @@ -15,11 +15,11 @@ class PopularSearchService end def each_search(limit = 100, &block) - fetch_data.to_s.scan(/(.+?) (\d+)\.0\n/).slice(0, limit).each(&block) + JSON.parse(fetch_data.to_s).slice(0, limit).each(&block) end def tags - fetch_data.to_s.scan(/(.+?) (\d+)\.0\n/).map {|x| x[0]} + JSON.parse(fetch_data.to_s).map {|x| x[0]} end def fetch_data