getTitles
Retrieves the titles for the path browse
on the desktop site
Parameters
params | type | Required | Description |
---|---|---|---|
html | string | Yes | Plain html text. |
Return
Returns an array of objects containing the following data:
typescript
{
title: string;
type: string;
description: string;
cover: string;
slug: string;
}
{
title: string;
type: string;
description: string;
cover: string;
slug: string;
}
Targets
Here, we present the current sources from which this function retrieves data for the titles.
Details
title
The title name
type
Type of the Title
description
Synopsis/Overview of the Title
cover
This takes the actual cover/banner of the title
slug
Returns the
slug
for the path/anime
Usage
- Import the
getTitles
method.
typescript
import { getTitles } from '@untidy/animeflv/cheerio';
import { getTitles } from '@untidy/animeflv/cheerio';
- Pass the parsed HTML text for the
/browse
path:
typescript
const data = getTitles(html);
const data = getTitles(html);
- As an example, we provide a minimal representation of the retrieved titles:
javascript
[
{
title: 'Black Clover: Mahou Tei no Ken',
description: '',
slug: '/anime/black-clover-mahou-tei-no-ken',
type: 'Película',
cover: 'https://animeflv.net/uploads/animes/covers/3816.jpg',
},
{
title: 'Niehime to Kemono no Ou',
description:
'En un reino en el que los humanos han de servir al rey de los demonios, Sariphi es ofrecida como sacrificio. Sin embargo, con su carisma no tardará en conquistar al rey de los demonios.',
slug: '/anime/niehime-to-kemono-no-ou',
type: 'Anime',
cover: 'https://animeflv.net/uploads/animes/covers/3811.jpg',
},
// and goes on...
];
[
{
title: 'Black Clover: Mahou Tei no Ken',
description: '',
slug: '/anime/black-clover-mahou-tei-no-ken',
type: 'Película',
cover: 'https://animeflv.net/uploads/animes/covers/3816.jpg',
},
{
title: 'Niehime to Kemono no Ou',
description:
'En un reino en el que los humanos han de servir al rey de los demonios, Sariphi es ofrecida como sacrificio. Sin embargo, con su carisma no tardará en conquistar al rey de los demonios.',
slug: '/anime/niehime-to-kemono-no-ou',
type: 'Anime',
cover: 'https://animeflv.net/uploads/animes/covers/3811.jpg',
},
// and goes on...
];