36def response(resp:
"SXNG_Response") -> EngineResults:
40 json_resp = resp.text[resp.text.find(
"\n") + 1 : resp.text.rfind(
"\n") - 2]
42 conversion_rate = float(json.loads(json_resp)[
"to"][0][
"mid"])
46 params: OnlineCurrenciesParams = resp.search_params
47 answer =
"{0} {1} = {2} {3} (1 {5} : {4} {6})".format(
49 params[
"from_iso4217"],
50 params[
"amount"] * conversion_rate,
56 url = ddg_link_url % params
57 res.add(res.types.Answer(answer=answer, url=url))