View Source Foresight (Foresight v0.6.0)

Documentation for Foresight.

Summary

Functions

Get a page struct if the URL is a real website.

Get a page struct if the URL is a real website, otherwise return error.

Functions

get_meta_tags!(url)

get_page(url, fields \\ default_fields())

Get a page struct if the URL is a real website.

Examples

iex> Foresight.get_page("https://google.com") {:ok,

%Foresight.Page{
  description: "Hurra for Halloween 2020! #GoogleDoodle",
  image: "https://www.google.com/logos/doodles/2020/halloween-2020-6753651837108597.5-2xa.gif",
  title: "Google",
  url: "https://google.com"
}

}

get_page!(url, fields \\ default_fields())

Get a page struct if the URL is a real website, otherwise return error.

Examples

iex> Foresight.get_page("https://google.com") %Foresight.Page{

description: "Hurra for Halloween 2020! #GoogleDoodle",
image: "https://www.google.com/logos/doodles/2020/halloween-2020-6753651837108597.5-2xa.gif",
title: "Google",
url: "https://google.com"

}