- Source:
Methods
(async, inner) getShayaris(rekhtaUrl, selector, isSinglePoet, count) → {Promise.<Array.<{shayari: String, poet: String, url: String}>>|Promise.<Array.<{shayari: String, url: String}>>}
Fetch shayaris from a Rekhta URL using a specificed selector.
Parameters:
Name | Type | Description |
---|---|---|
rekhtaUrl |
String | URL to scrape |
selector |
String | HTML selector to fetch data |
isSinglePoet |
Boolean | Shayaris of a single poet or not |
count |
Number | Count of shayaris to return |
- Source:
Returns:
- Type
- Promise.<Array.<{shayari: String, poet: String, url: String}>> | Promise.<Array.<{shayari: String, url: String}>>
(async, inner) getShayarisByPoet(poet, language, count, sort, order) → {Promise.<Array.<{shayari: String, url: String}>>}
Fetch shayaris by a specific poet.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
poet |
String | Poet to get shayaris of |
|
language |
String | en | Language to get results in |
count |
Number | false | Count of shayaris to return |
sort |
String | popularity | Result sorting parameters |
order |
String | desc | Order of sorting |
- Source:
Throws:
-
InvalidLanguageError
-
InvalidCountError
-
InvalidSortParamError
-
InvalidOrderParamError
Returns:
- Type
- Promise.<Array.<{shayari: String, url: String}>>
(async, inner) getShayarisByTag(tag, language, count, sort, order) → {Promise.<Array.<{shayari: String, poet: String, url: String}>>}
Fetch shayaris by a specific tag.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tag |
String | Tag to get shayaris of |
|
language |
String | en | Language to get results in |
count |
Number | false | Count of shayaris to return |
sort |
String | popularity | Result sorting parameters |
order |
String | desc | Order of sorting |
- Source:
Throws:
-
InvalidLanguageError
-
InvalidCountError
-
InvalidSortParamError
-
InvalidOrderParamError
Returns:
- Type
- Promise.<Array.<{shayari: String, poet: String, url: String}>>
(async, inner) getTop20CoupletsByTag(tag, language) → {Promise.<Array.<{shayari: String, poet: String, url: String}>>}
Fetch top 20 couplets by a specific tag.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tag |
String | Tag to get couplets of |
|
language |
String | en | Language to get results in |
- Source:
Throws:
-
InvalidTagError
-
InvalidLanguageError
Returns:
- Type
- Promise.<Array.<{shayari: String, poet: String, url: String}>>
(async, inner) getTop20ShayarisByPoet(poet, language) → {Promise.<Array.<{shayari: String, url: String}>>}
Fetch top 20 shayaris by a specific poet.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
poet |
String | Poet to get shayaris of |
|
language |
String | en | Language to get results in |
- Source:
Throws:
Returns:
- Type
- Promise.<Array.<{shayari: String, url: String}>>
(async, inner) getTop20ShayarisByTag(tag, language) → {Promise.<Array.<{shayari: String, poet: String, url: String}>>}
Fetch top 20 shayaris by a specific tag.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tag |
String | Tag to get shayaris of |
|
language |
String | en | Language to get results in |
- Source:
Throws:
-
InvalidTagError
-
InvalidLanguageError
Returns:
- Type
- Promise.<Array.<{shayari: String, poet: String, url: String}>>
(async, inner) getTop5ShayarisByDay(date, language) → {Promise.<Array.<{shayari: String, poet: String, url: String}>>}
Get top 5 shayaris of the day for a given date.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
date |
String | Date in YYYY-MM-DD format |
|
language |
String | en | Language to get results in |
- Source:
Throws:
-
DateFormatError
-
InvalidLanguageError
Returns:
- Type
- Promise.<Array.<{shayari: String, poet: String, url: String}>>