Skip to content

getTitles

Retrieves the titles for the path browse on the desktop site

Parameters

paramstypeRequiredDescription
htmlstringYesPlain 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

anime target

  • title

    The title name

    title target

  • type

    Type of the Title

    type target

  • description

    Synopsis/Overview of the Title

    description target

  • cover

    This takes the actual cover/banner of the title

    cover target

  • slug

    Returns the slug for the path /anime

Usage

  1. Import the getTitles method.
typescript
import { getTitles } from '@untidy/animeflv/cheerio';
import { getTitles } from '@untidy/animeflv/cheerio';
  1. Pass the parsed HTML text for the /browse path:
typescript
const data = getTitles(html);
const data = getTitles(html);
  1. 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...
];