Ruby library which tries to find the most likely favicon for a given URL.
It does so via HTTP HEAD requests and traversing up the URI path.
Add this line to your application's Gemfile:
gem 'bildchen', github: 'glaszig/bildchen'
And then execute:
$ bundle
Cached:
Bildchen['http://www.example.com/path/to/somewhere']
Uncached:
bildchen = Bildchen::Resolver.new 'http://www.example.com/path/to/somewhere'
bildchen.resolve
HTTP timeouts default to 5 seconds and can be tuned as follows
Bildchen.timeout = 10
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request