faviconr
Service (and a pluggable Node.js express app) for resolving a favicon for a given URL
Last updated 7 years ago by andreypopp .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install faviconr 
SYNC missed versions from official npm registry.

Faviconr

Service (and a Node express app) for resolving favicons for a given URL.

It tries to lookup /favicon.ico (following redirects) and if nothing found then it fetches the URL and parses HTML to find a <link rel="icon" ... > element.

Usage as a service

Service is deployed at http://faviconr.qp.pe so you can just cURL it with url as GET parameter:

% curl http://faviconr.qp.pe/?url=http://google.com

The faviconr repository is ready to be deployed as Heroku or Dokku service.

Usage as a library

Faviconr is designed as a reusable express application so you can embed this functionality inside your own app like this:

var express = require('express');
var faviconr = require('faviconr');

var app = express();
app.use('/api/favicon', faviconr());
...
app.listen(8000);

Now your app will resolve favicons at http://localhost:8000/api/favicon:

% curl http://localhost:8000/api/favicon?url=http://google.com

Current Tags

  • 0.3.0                                ...           latest (7 years ago)

4 Versions

  • 0.3.0                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 3
Dependencies (5)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |