Created
June 5, 2017 13:15
-
-
Save dongyuwei/dfac2fef04f61f7316c09bebb421eecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module (translation). | |
-export ([get_translation/1]). | |
get_translation(Word) -> | |
io:format("~p ~n", [Word]), | |
inets:start(), | |
{ok, RequestId} = httpc:request(get, {"http://fanyi.dict.cn/search.php?q=" ++ Word, []}, [], [{sync, false}]), | |
receive | |
{http, {RequestId, Result}} -> | |
io:format("~p ~n", [Result]) | |
after 1000 -> timeout | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment