RetrieveFavicon 获取任何站点的 favicon
{% codeblock lang:csharp%} [TestMethod] public void CanGetFaviconIco() { var faviconUrl = Common.Helper.RetrieveFavicon.Favicon.RetrieveFavicon("https://github…

开源了一个获取任何站点 favicon 的类库,供使用。
RetrieveFavicon
Project GitHub Retrieve favicon from any website url using C#. A part of project GuGuJianKong backend API.
Retrieve favicon type
- direct retrieve
$website url/favicon.ico - retrieve
hreffrom website content where contains<link rel="* icon" href="..." /> - retrieve
hreffrom website content where contains<link rel="apple-touch-icon" href="..." />
Usage
{% codeblock lang:csharp%} [TestMethod] public void CanGetFaviconIco() { var faviconUrl = Common.Helper.RetrieveFavicon.Favicon.RetrieveFavicon(“https://github.com/parryqiu”); Debug.Print(faviconUrl); Assert.IsTrue(faviconUrl != null); } {% endcodeblock %}