add most viewed posts page
This commit is contained in:
@@ -4,7 +4,7 @@ class PostViewCountService
|
||||
end
|
||||
|
||||
def initialize
|
||||
if !MissedSearchService.enabled?
|
||||
if !PostViewCountService.enabled?
|
||||
raise NotImplementedError.new("the Reportbooru service isn't configured. Missed searches are not available.")
|
||||
end
|
||||
end
|
||||
@@ -30,4 +30,9 @@ class PostViewCountService
|
||||
rescue JSON::ParserError
|
||||
nil
|
||||
end
|
||||
|
||||
def popular_posts(date = Date.today)
|
||||
ranking = fetch_rank(date)
|
||||
ranking.map {|x| Post.find(x[0])}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user