account for https
This commit is contained in:
@@ -17,10 +17,10 @@ module Reports
|
||||
"key" => Danbooru.config.shared_remote_key,
|
||||
"user_id" => user_id
|
||||
}
|
||||
uri = URI.parse("#{Danbooru.config.listbooru_server}/reports/user_similarity")
|
||||
uri = URI.parse("#{Danbooru.config.report_server}/reports/user_similarity")
|
||||
uri.query = URI.encode_www_form(params)
|
||||
|
||||
Net::HTTP.start(uri.host, uri.port) do |http|
|
||||
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.is_a?(URI::HTTPS)) do |http|
|
||||
resp = http.request_get(uri.request_uri)
|
||||
if resp.is_a?(Net::HTTPSuccess)
|
||||
resp.body
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class UserSimilarityPresenter
|
||||
attr_reader :report, :not_ready
|
||||
attr_reader :report, :user_ids, :not_ready
|
||||
|
||||
def initialize(report)
|
||||
@report = report
|
||||
@@ -17,7 +17,7 @@ class UserSimilarityPresenter
|
||||
def fetch
|
||||
user_ids = report.fetch_similar_user_ids
|
||||
|
||||
if user_ids = "not ready"
|
||||
if user_ids == "not ready"
|
||||
@not_ready = true
|
||||
else
|
||||
@user_ids = user_ids.scan(/\d+/).slice(0, 10)
|
||||
|
||||
Reference in New Issue
Block a user