Web Module

This modules contains every internal function related to the web (making web requests).

Documentation

Function documentation is using a specific syntax. More information here.

tp.web.daily_quote()

Retrieves and parses the daily quote from the API https://api.quotable.io as a callout.

Examples
// Daily quote
<% tp.web.daily_quote() %>

tp.web.random_picture(size?: string, query?: string, include_size?: boolean)

Gets a random image from https://unsplash.com/.

Arguments
  • size: Image size in the format <width>x<height>.

  • query: Limits selection to photos matching a search term. Multiple search terms can be passed separated by a comma.

  • include_size: Optional argument to include the specified size in the image link markdown. Defaults to false.

Examples
// Random picture
<% tp.web.random_picture() %>
// Random picture with size
<% tp.web.random_picture("200x200") %>
// Random picture with size and query
<% tp.web.random_picture("200x200", "landscape,water") %>

Examples

// Daily quote
<% tp.web.daily_quote() %>

// Random picture
<% tp.web.random_picture() %>
// Random picture with size
<% tp.web.random_picture("200x200") %>
// Random picture with size and query
<% tp.web.random_picture("200x200", "landscape,water") %>