Method: AutoPilot.get_api_answers

Defined in:
lib/auto_pilot.rb

.get_api_answersObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/auto_pilot.rb', line 13

def get_api_answers
  parsed_documents = []
  answers = AutoPilot::API.new.get_answers
  answers.each do |answer|
    question_id = answer[:question_id]
    answer_id   = answer[:answer_id]
    url = page_with_my_answer(question_id)
    doc = Request.fetch url
    # Log.green "question id #{question_id} | answer id #{answer_id}"
    parsed_documents << DocumentParser.new(doc, question_id, answer_id)
  end
  parsed_documents
end