1.0.0 • Published 2 years ago

dmhy-get-api-unofficial v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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).