Module: ghazal

Source:

Methods

(async, inner) getGhazals(rekhtaUrl, selector, isSinglePoet, count) → {Promise.<Array.<{ghazal: String, poet: String, url: String}>>|Promise.<Array.<{ghazal: String, url: String}>>}

Fetch ghazals from a Rekhta URL using a specified selector.

Parameters:
Name Type Description
rekhtaUrl String

URL to scrape

selector String

HTML selector to fetch data

isSinglePoet Boolean

Ghazals of a single poet or not

count Number

Count of ghazals to return

Source:
Returns:
Type
Promise.<Array.<{ghazal: String, poet: String, url: String}>> | Promise.<Array.<{ghazal: String, url: String}>>

(async, inner) getGhazalsByPoet(poet, language, count, sort, order) → {Promise.<Array.<{nazm: String, url: String}>>}

Fetch ghazals by a specific poet.

Parameters:
Name Type Default Description
poet String

Poet to get ghazals of

language String en

Language to get results in

count Number false

Count of ghazals to return

sort String popularity

Result sorting parameters

order String desc

Order of sorting

Source:
Throws:
  • InvalidLanguageError
  • InvalidCountError
  • InvalidGhazalSortParamError
  • InvalidOrderParamError
Returns:
Type
Promise.<Array.<{nazm: String, url: String}>>

(async, inner) getGhazalsByTag(tag, language, count, sort, order) → {Promise.<Array.<{ghazal: String, poet: String, url: String}>>}

Fetch ghazals by a specific tag.

Parameters:
Name Type Default Description
tag String

Tag to get ghazals of

language String en

Language to get results in

count Number false

Count of ghazals to return

sort String popularity

Result sorting parameters

order String desc

Order of sorting

Source:
Throws:
  • InvalidLanguageError
  • InvalidCountError
  • InvalidGhazalSortParamError
  • InvalidOrderParamError
Returns:
Type
Promise.<Array.<{ghazal: String, poet: String, url: String}>>