Esempio n. 1
0
def yoda_say(question):
  session = AsyncSession()
  session.obj = question
  answer = correct_textspeak(question.answer)
  answer = add_fullstop(answer)
  parameters = {"sentence":answer}
  heads = {'X-Mashape-Authorization':mashape_key}
  call = session.get(mashape_api, params=parameters, headers=heads, background_callback=yoda_handler)
Esempio n. 2
0
def yahoo_ask(text_message):
  yahoo_session = AsyncSession()
  yahoo_session.obj = text_message
  question = sanitize_question(text_message) 
  parameters = {"query":question, 
      "search_in":"question",
      "appid":yahoo_api_key, 
      "output":"json",
      "type":"resolved"}
  yahoo_session.get(yahoo_question_url, params=parameters, background_callback=yahoo_question_callback)