Method: OTX::URL#get_url_list

Defined in:
lib/otx_ruby/url.rb

#get_url_list(url) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/otx_ruby/url.rb', line 13

def get_url_list(url)
  uri = "/api/v1/indicators/url/#{url}/url_list"

  page = 0
  url_list = []
  begin
    page += 1
    params = {limit: 20, page: page}
    json_data = get(uri, params)
    has_next = json_data['has_next']

    url_list += json_data['url_list']
  end while has_next

  results = []
  url_list.each do |url|
    results << OTX::Indicator::IP::URL.new(url)
  end

  return results
end