23 lines
898 B
Markdown
23 lines
898 B
Markdown
|
---
|
||
|
layout: post.html
|
||
|
title: "T.I.L. How to get the favicon of any site"
|
||
|
summary: "Today I Learnt: How to get the favicon of any site"
|
||
|
date: 2020-11-10T09:49:37+01:00
|
||
|
tags: til
|
||
|
|
||
|
---
|
||
|
|
||
|
If you ever find yourself needing to display a small icon for a 3rd party URL but don't want to have to crawl the site to pull out the favicon URL then you can make use of a Google CDN:
|
||
|
|
||
|
```
|
||
|
https://s2.googleusercontent.com/s2/favicons?domain_url=https://marcusnoble.co.uk/
|
||
|
```
|
||
|
|
||
|
Example: ![](https://s2.googleusercontent.com/s2/favicons?domain_url=https://marcusnoble.co.uk/)
|
||
|
|
||
|
You can even provide any page, not just the root URL.
|
||
|
|
||
|
e.g. `https://s2.googleusercontent.com/s2/favicons?domain_url=https://marcusnoble.co.uk/2020-11-10-t-i-l-how-to-get-the-favicon-of-any-site/`
|
||
|
|
||
|
![](https://s2.googleusercontent.com/s2/favicons?domain_url=https://marcusnoble.co.uk/2020-11-10-t-i-l-how-to-get-the-favicon-of-any-site/)
|