Method: Codeforces::Viewer::Viewer#fetch_output
- Defined in:
- lib/codeforces/viewer/viewer.rb
#fetch_output(output_id, contest_id, problem_id) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/codeforces/viewer/viewer.rb', line 48 def fetch_output(output_id, contest_id, problem_id) url = Codeforces::Viewer::Utils.get_problem_url(contest_id, problem_id) body = @cacher.get_url url doc = Nokogiri::HTML(body) @render.render_output(output_id, doc.xpath('//div[@class="sample-test"]')).map {|item| item.text.strip + "\n" }.join end |