Very simple tool to get the final destination of a potential redirects URL. Based on HTTPotion.
If available in Hex, the package can be installed
by adding poucet to your list of dependencies in mix.exs:
def deps do
[
{:poucet, "~> 0.1.0"}
]
endiex> Poucet.final_location("https://t.co/2m6SRbn6or")
{:ok,
"https://www.eurogamer.net/articles/2019-11-04-londons-pokemon-center-is-running-out-of-its-exclusive-top-hat-pikachus"}
iex> Poucet.final_location("https://github.com/404")
{:error, 404}Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/poucet.