本文总阅读量:  次 | 文章总字数: 246 字

RetrieveFavicon 获取任何站点的 favicon

Website Favicon
开源了一个获取任何站点 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 href from website content where contains <link rel="* icon" href="..." />
  • retrieve href from website content where contains <link rel="apple-touch-icon" href="..." />

Usage

[TestMethod]
public void CanGetFaviconIco()
{
    var faviconUrl = Common.Helper.RetrieveFavicon.Favicon.RetrieveFavicon("https://github.com/parryqiu");
    Debug.Print(faviconUrl);
    Assert.IsTrue(faviconUrl != null);
}

NuGet References

EOF

转载须以超链接形式标明文章原始出处和作者信息