Module: SaucenaoAPI::API

Defined in:
lib/saucenao.rb

Constant Summary collapse

API_BASE =
'https://saucenao.com'

Class Method Summary collapse

Class Method Details

.get(url = '', params = {}) ⇒ Object


52
53
54
55
56
# File 'lib/saucenao.rb', line 52

def get(url = '', params = {})
  params
  response = RestClient.get("#{API_BASE}/#{url}", params: params)
  JSON.parse(response)
end

.search(url, key, output_type, numres, minsim, dbmask) ⇒ Object


48
49
50
# File 'lib/saucenao.rb', line 48

def search(url, key, output_type, numres, minsim, dbmask)
  get('search.php', url: url, api_key: key, output_type: output_type, numres: numres, minsim: minsim, dbmask: dbmask)
end