Skip to content

LuckyYam/mal-news-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})()