logo scrape
1.0.0
Raspar logotipo
LogoScrape
extrai o logotipo de um (s) URL (s) fornecido (s) para seus aplicativos Node.js.
Confira a demonstração para vê-lo em ação!
Instalação
Importar
Uso
API
Demonstração
Licença
$ npm eu raspar o logotipo
const { LogoScrape } = require('logo-scrape');
importar { LogoScrape } de 'logo-scrape';
getLogo()
ou getLogos()
aceita URL(s) e retorna a saída para o(s) URL(s) fornecido(s)
(async () => {const url = 'http://techcrunch.com';const logo = await LogoScrape.getLogo(url);const logos = await LogoScrape.getLogos(url);console.log({logotipo, logotipos });const urls = ['http://techcrunch.com' , 'http://producthunt.com'];const logoUrls = aguardar LogoScrape.getLogo(urls);const logosUrls = aguarda LogoScrape.getLogos(urls);console.log({logoUrls, logosUrls});})();
Produzirá o resultado abaixo;
{ "logo": {"type": "link-rel/icon","url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png ?w=32","tamanho": "32x32" }, "logotipos": [ { "type": "link-rel/icon", "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32" , "tamanho": "32x32"}, { "type": "link-rel/icon", "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=192" , "tamanho": "192x192"}, { "type": "link-rel/icon", "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=180" }, { "type": "meta-name/msapplication-TileImage", "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w= 270"}, { "type": "og:image", "url": "https://techcrunch.com/wp-content/themes/techcrunch-2017/images/opengraph-default.png"} ] }
E para vários URLs
{ "logoUrls": [ { "type": "link-rel/icon", "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32" , "tamanho": "32x32"}, { "type": "link-rel/icon", "url": "https://assets.producthunt.com/assets/ph-ios-icon-e1733530a1bfc41080db8161823f1ef262cdbbc933800c0a2a706f70eb9c277a.png"} ], "logosUrls": [ [ {"type": "link-rel/icon","url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32" ,"tamanho": "32x32" }, {"type": "link-rel/icon","url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=192" ,"tamanho": "192x192" }, {"type": "link-rel/icon","url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=180" }, {"type": "meta-name/msapplication-TileImage","url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w= 270"}, {"type": "og:image","url": "https://techcrunch.com/wp-content/themes/techcrunch-2017/images/opengraph-default.png" } ], [ {"type": "link-rel/icon","url": "https://assets.producthunt.com/assets/ph-ios-icon-e1733530a1bfc41080db8161823f1ef262cdbbc933800c0a2a706f70eb9c277a.png" }, {"type": "link-rel/icon","url": "https://www.producthunt.com/favicon.ico" }, {"type": "og:image","url": "https://www.producthunt.comhttps://api.url2png.com/v6/P5329C1FA0ECB6/790272390317dc724643b1ca88f5da6e/png/?url=https%3A%2F %2Fwww.producthunt.com%2F" }, {"type": "svg:image","dados": true,"url": "dados:imagem/svg+xml,%3Csvg%20largura%3D%2240%22%20altura%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20xmlns%3D%22http%3A% 2F%2Fwww.w3 .org% 2F2000% 2Fsvg% 22% 3E% 3Cg% 20fill% 3D% 22none% 22% 20fill-rule% 3D% 22evenodd% 22% 3E% 3Cpath% 20d% 3D% 22M40% 2020c0% 2011.046-8.954% 2020-20 %202 0S0%2031,046%200%2020%208,954%200%2020%200s20%208,954%2020%2020%22 %20preenchimento%3D%22%23DA552F%22%2F%3E%3Ccaminho%20d%3D%22M22.667%2020H17v-6 h5.667a3%203%200%200%201%200%206m0-10H13v20h4v-6h5.667a7%207%200%2 01%200%200-14%22%20preenchimento%3D%22%23FFF%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E" } ] ] }
A API gerada com TypeDoc pode ser encontrada aqui.
Sinta-se à vontade para enviar solicitações pull, criar problemas ou divulgar.
MIT © Fritz Hoste