def lookup_totals
    begin
      Timeout.timeout(4) do
        html = open("https://projecteuler.net/recent")
        fragment = Nokogiri::HTML(html)

        id_col = fragment.css('#problems_table td.id_column')

        # The newest problem is the first one listed on the recent page. The ID 
        # of this problem will always equal the total number of problems.
        id_col.first.text.to_i.times { Problem.new }
        # There are ten problems on the recent page, so the last archive problem 
        # can be found by subtracting 10 from the total number of problems.
        Page.total = Problem.page(Problem.total - 10) 
      end
    rescue Timeout::Error
      puts "Project Euler is not responding."

      exit(true)
    end
  end
def lookup_totals
    begin
      Timeout.timeout(4) do
        html = open("https://projecteuler.net/recent")
        fragment = Nokogiri::HTML(html)

        id_col = fragment.css('#problems_table td.id_column')

        # The newest problem is the first one listed on the recent page. The ID 
        # of this problem will always equal the total number of problems.
        id_col.first.text.to_i.times { Problem.new }
        # There are ten problems on the recent page, so the last archive problem 
        # can be found by subtracting 10 from the total number of problems.
        Page.total = Problem.page(Problem.total - 10) 
      end
    rescue Timeout::Error
      puts "Project Euler is not responding."

      exit(true)
    end
  end
Pulls information from the recent page to determine the total number of
 problems and pages.