LinkFetch v0.1.3 LinkFetch View Source

Simple module with the fetch function asked in the exercice.

Link to this section Summary

Functions

Returns all links in image and anchor tags from an HTML.

Link to this section Functions

Returns all links in image and anchor tags from an HTML.

Returns :ok and a tuple with two lists (image links and anchor links) if no problems arise.

Returns :error and the Reason from :httpc.request (see http://erlang.org/doc/man/httpc.html#request-5) otherwise.

Examples

iex> LinkFetch.fetch('https://www.newgrounds.com/')
{:ok,
 {["https://picon.ngfiles.com/758000/flash_758556.png?f1592892645",
  "https://picon.ngfiles.com/758000/flash_758415.png?f1592791808", ...],
 ["https://www.newgrounds.com/bbs/topic/1453142",
  "https://www.newgrounds.com/bbs/topic/1451785", ...]}}