fix popular search service

This commit is contained in:
r888888888
2018-05-27 03:38:28 -07:00
parent 1ea0dccd7f
commit d0639afa63

View File

@@ -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