fix popular search service
This commit is contained in:
@@ -15,11 +15,11 @@ class PopularSearchService
|
|||||||
end
|
end
|
||||||
|
|
||||||
def each_search(limit = 100, &block)
|
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
|
end
|
||||||
|
|
||||||
def tags
|
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
|
end
|
||||||
|
|
||||||
def fetch_data
|
def fetch_data
|
||||||
|
|||||||
Reference in New Issue
Block a user