Quotes (quotes v1.0.10)
Documentation for Quotes.
Link to this section Summary
Functions
parse_json
returns a list of maps containing quotes. <br />
random
returns a random quote. <br />
random_by_tag
returns a random quote for the chosen tag/keyword.
Link to this section Functions
Link to this function
parse_json()
parse_json
returns a list of maps containing quotes. <br />
The format returned is:
[
%{
"author" => "Albert Einstein",
"text" => "Once we accept our limits, we go beyond them."
},
%{
"author" => "Peter Drucker",
"source" => "https://www.goodreads.com/quotes/784267",
"tags" => "time, management",
"text" => "Until we can manage time, we can manage nothing else."
}
%{...},
...
]
All quotes MUST have an author
and text
field. <br />
Some quotes have tags
and source
,
please help to expand/verify others. <br />
see: https://github.com/nelsonic/quotes#contributing
Link to this function
random()
random
returns a random quote. <br />
e.g:
%{
"author" => "Peter Drucker",
"source" => "https://www.goodreads.com/quotes/784267",
"tags" => "time, management",
"text" => "Until we can manage time, we can manage nothing else."
}
Link to this function
random_by_tag(tag)
random_by_tag
returns a random quote for the chosen tag/keyword.
e.g:
iex> Quotes.random_by_tag("time")
%{
"author" => "Leo Tolstoy",
"text" => "The two most powerful warriors are patience and time."
}