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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -5,10 +5,8 @@
|
||||
<li id="secondary-links-posts-hot"><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
||||
<li id="secondary-links-posts-popular"><%= link_to "Popular", popular_explore_posts_path %></li>
|
||||
<li id="secondary-links-posts-curated"><%= link_to "Curated", curated_explore_posts_path %></li>
|
||||
<% if PopularSearchService.enabled? %>
|
||||
<% if ReportbooruService.enabled? %>
|
||||
<li><%= link_to "Searches", searches_explore_posts_path %></li>
|
||||
<% end %>
|
||||
<% if PostViewCountService.enabled? %>
|
||||
<li><%= link_to "Viewed", viewed_explore_posts_path %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</url>
|
||||
|
||||
<% cache("sitemap", :expires_in => 24.hours) do %>
|
||||
<% @popular_search_service.each_search do |tags, count| %>
|
||||
<% @reportbooru_service.post_search_rankings(Date.yesterday) do |tags, count| %>
|
||||
<url>
|
||||
<loc><%= posts_url(tags: tags) %></loc>
|
||||
<lastmod><%= Date.today %></lastmod>
|
||||
@@ -38,4 +38,4 @@
|
||||
</url>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</urlset>
|
||||
</urlset>
|
||||
|
||||
Reference in New Issue
Block a user