dmhy-get-api-unofficial
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

dmhy-get-api-unofficial

Yet another DMHY scraper

npm

Swagger Doc

Demonstration

Built in React UI

Quick Start

npm install dmhy-get-api-unofficial

Use the express app or router

import { dmhyRouter } from "dmhy-get-api-unofficial" // router
import { app as yourApp } from "dmhy-get-api-unofficial" // express app instance

Use the scraper

import { scrapeDMHYList } from "dmhy-get-api-unofficial"
interface DMHYSearchQuery {
  keyword?: string | number;
  sort_id?: string | number;
  team_id?: string | number;
  user_id?: string | number;
  order?: 'date-desc' | 'date-asc' | 'rel';
  page?: string | number;
}

async function scrapeDMHYList(
  queries: DMHYSearchQuery = {},
  options: Record<string, unknown> = {},
): Promise<string> // return the html text

Use the parser

import { parseDMHYList, parseDMHYSearchOptions } from "dmhy-get-api-unofficial"
  • parseDMHYSearchOptions(): returns directly the advanced search options (see swagger).
  • parseDMHYList(html: string): returns info scraping from list view (see swagger).

Readme

Keywords

Package Sidebar

Install

npm i dmhy-get-api-unofficial

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.2 MB

Total Files

79

Last publish

Collaborators

  • yinyan