Skip to content

Latest commit

 

History

History
44 lines (38 loc) · 1.24 KB

README.md

File metadata and controls

44 lines (38 loc) · 1.24 KB

mal-news-scraper

NPM

Scrap news contents from MyAnimeList


Installation

yarn add @shineiichijo/mal-news-scraper

Usage

import { scrapNews } from '@shineiichijo/mal-news-scraper'
;(async () => {
    const id = 66853767
    const data = await scrapNews(id)
    console.log(data)
})()

Output

{
    "id": "66853767",
    "url": "https://myanimelist.net/news/66853767",
    "image": "https://cdn.myanimelist.net/s/common/uploaded_files/1657685189-06702246fa60423ef634534239999439.jpeg",
    "description": "The official website of the One Piece Film: Red anime movie revealed a pair ....",
    "title": "'One Piece Film: Red' Reveals Additional Pair of Cast"
}

Scrapping with mal-scraper

import { getNewsNoDetails } from 'mal-scraper' //yarn add mal-scraper
import { scrapNews } from '@shineiichijo/mal-news-scraper'
;(async () => {
    const news = await getNewsNoDetails()
    const link = news[0].link // --> https://myanimelist.net/news/66853767
    const data = await scrapNews(link)
    console.log(data)
})()