phantom-marmiton/docs/modules/marmiton_parsing.md
2022-01-08 00:55:27 +01:00

35 lines
1.0 KiB
Markdown

[phantom-exo](../README.md) / [Modules](../modules.md) / marmiton/parsing
# Module: marmiton/parsing
## Table of contents
### Functions
- [scrapResultFromLink](marmiton_parsing.md#scrapresultfromlink)
## Functions
### scrapResultFromLink
`Const` **scrapResultFromLink**(`links`, `urlStart`): { `commentCount`: `number` ; `name`: `string` ; `score`: `number` ; `url`: `string` }[]
function that extract content from DOM links into the marmiton search page
#### Parameters
| Name | Type | Description |
| :--------- | :---------- | :--------------------------------------------------------- |
| `links` | `Element`[] | scrapped <a> dom elements representing recipes in marmiton |
| `urlStart` | `string` | url to prefix recipes links |
#### Returns
{ `commentCount`: `number` ; `name`: `string` ; `score`: `number` ; `url`: `string` }[]
name, link, comments and score of recipes
#### Defined in
marmiton/parsing.ts:7