Refactor Reportbooru API clients.

* Combine MissedSearchService, PostViewCountService, and
  PopularSearchService into single ReportbooruService class.
* Use Danbooru::Http for these services instead of HTTParty.
This commit is contained in:
evazion
2020-06-14 00:24:15 -05:00
parent 1846133cd6
commit a4df18e650
17 changed files with 102 additions and 143 deletions

View File

@@ -15,7 +15,7 @@
</tr>
</thead>
<tbody>
<% @search_service.each_search do |tags, count| %>
<% @search_service.missed_search_rankings do |tags, count| %>
<tr class="tag-type-<%= Tag.category_for(tags) %>">
<td><%= link_to tags, posts_path(:tags => tags) %></td>
<td>

View File

@@ -3,7 +3,7 @@
<div id="c-explore-posts">
<div id="a-searches">
<h1>Popular Searches - <%= @search_service.date %></h1>
<h1>Popular Searches - <%= @date %></h1>
<table class="striped" width="100%">
<thead>
@@ -13,7 +13,7 @@
</tr>
</thead>
<tbody>
<% @search_service.each_search do |tags, count| %>
<% @search_service.post_search_rankings(@date) do |tags, count| %>
<tr class="tag-type-<%= Tag.category_for(tags) %>">
<td><%= link_to tags, posts_path(:tags => tags) %></td>
<td style="text-align: right;"><%= count.to_i %></td>