@shineiichijo/mal-news-scraper
v0.0.2
Published
Scraps news contents from MyAnimeList
Downloads
262
Maintainers
Readme
mal-news-scraper
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)
})()