urlpreview v0.0.3 Urlpreview

Documentation for Urlpreview.

Summary

Functions

Returns true or false based on if a URL is valid to fetch meta data from In order for a site to be valid it must have the http or https protocol specified

Returns relevant meta data about the given url In the event the url is able to be proccessed a RuntimeError error is raised

Functions

is_valid_url?(url)

Returns true or false based on if a URL is valid to fetch meta data from In order for a site to be valid it must have the http or https protocol specified

Examples

iex> Urlpreview.is_valid_url?("https://www.google.com")
true

iex> Urlpreview.is_valid_url?("mysite.com")
false
preview(url)

Returns relevant meta data about the given url In the event the url is able to be proccessed a RuntimeError error is raised

Examples

iex> Urlpreview.preview("http://example.com")
%{description: nil, images: [], real_url: "http://example.com", title: "Example Domain", url: "http://example.com"}

iex> Urlpreview.preview("http://myfakedomainthatisntgoingtoreturnsuccess.com")
** (RuntimeError) An unknown error has occurred.