Marko Taht
Marko Taht

Reputation: 1526

Erlang fetch data from the web

How can I fetch data (like temperature, etc.) from webpages using erlang? I have been trying to find some tutorial about it but cant seem to find any. I found that I can store data in Records but how can i fetch it from the web?

Upvotes: 1

Views: 135

Answers (1)

Steve Pallen
Steve Pallen

Reputation: 4507

You want to use a http client. There are a number of them, but hackney is a popular one. You can also search Hex for other Erlang http clients.

As well as an http client, you may also want a package to parse the results. This depends on whether your getting JSON or HTML back. For HTML, you should probably use XPATH. For JSON, use a library like jsx.

Upvotes: 2

Related Questions