cover-image-crawler

1.0.5 • Public • Published

cover-image-crawler

npm package

NPM download Package Quality

Get the url of main image of page's using scraping in each IMG tag on the site and return the largest image found.

Usually it takes 1 second to return the result, if not found the return will be empty.

Installation

npm install cover-image-crawler

Use example

const imageCrawler = require('cover-image-crawler');

imageCrawler.capture('https://www.diariodepernambuco.com.br/noticia/viver/2019/07/vintage-culture-e-mais-cinco-atracoes-em-festival-eletronico-no-recife.html', function(err, image_url){
  if(!err){
    console.log(image_url);
  }
})

Use example - Async/Await

const imageCrawler = require('cover-image-crawler');

async function test(){
    
    let teste =  await imageCrawler.capture('https://www.bbc.com/news/world-us-canada-50863967');
    console.log(teste);
}
test()

Open to contributions and improvements

Newspaper sites working with accuracy

Test now on Vercel : https://info-link-node-api.vercel.app/

Work for future versions:

Ability options how: HTML tags to make the scraping (beyond <img)

Package Sidebar

Install

npm i cover-image-crawler

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

6.4 kB

Total Files

4

Last publish

Collaborators

  • wilsonfilho