Title: | Find the URL to the 'Favicon' for a Website |
---|---|
Description: | Finds the URL to the 'favicon' for a website. This is useful if you want to display the 'favicon' in an HTML document or web application, especially if the website is behind a firewall. |
Authors: | John Blischak [aut, cre] |
Maintainer: | John Blischak <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3.1 |
Built: | 2024-11-04 15:42:51 UTC |
Source: | https://github.com/jdblischak/faviconplease |
The search engine DuckDuckGo includes site favicons in its search results, and it makes this service publicly available. If it can't find a favicon, it returns a default fallback. faviconPlease uses this as a fallback function if the favicon can't be found directly via the standard methods.
faviconDuckDuckGo(server)
faviconDuckDuckGo(server)
server |
The name of the server, e.g. "www.r-project.org" |
Character vector
faviconDuckDuckGo("reactome.org")
faviconDuckDuckGo("reactome.org")
Use Google's favicon service
faviconGoogle(server)
faviconGoogle(server)
server |
The name of the server, e.g. "www.r-project.org" |
Character vector
faviconPlease
,
faviconDuckDuckGo
faviconGoogle("reactome.org")
faviconGoogle("reactome.org")
Check for the existence of favicon.ico
faviconIco( scheme, server, path, method = getOption("download.file.method", default = "auto"), extra = getOption("download.file.extra"), headers = NULL )
faviconIco( scheme, server, path, method = getOption("download.file.method", default = "auto"), extra = getOption("download.file.extra"), headers = NULL )
scheme |
"http" or "https" |
server |
The name of the server, e.g. "www.r-project.org" |
path |
The path to a target file on the server (must start with a forward slash) |
method |
Method to be used for downloading files. Current
download methods are The method can also be set through the option
|
extra |
character vector of additional command-line arguments for
the |
headers |
named character vector of additional HTTP headers to
use in HTTP[S] requests. It is ignored for non-HTTP[S] URLs. The
|
URL to favicon.ico
or ""
.
Search for a link element that specifies the location of the favicon
faviconLink(scheme, server, path)
faviconLink(scheme, server, path)
scheme |
"http" or "https" |
server |
The name of the server, e.g. "www.r-project.org" |
path |
The path to a target file on the server (must start with a forward slash) |
URL to favicon or ""
.
faviconPlease()
first applies the favicon functions specified in the
argument functions
. If these do not find a favicon URL, then it
applies the fallback function specified by the argument fallback
.
faviconPlease( links, functions = list(faviconLink, faviconIco), fallback = faviconDuckDuckGo )
faviconPlease( links, functions = list(faviconLink, faviconIco), fallback = faviconDuckDuckGo )
links |
Character vector of URLs |
functions |
List of functions for finding URL to a website's favicon. They are tried in order until a URL is found. If no URL is found, the fallback is applied. |
fallback |
Either a function or a single character vector. It is applied when none of the supplied functions are able to find a favicon. |
Character vector with URLs to the favicons for the websites specified
in the input argument links
. The URLs are generated from one of the
favicon functions specified in the input argument functions
. If a
favicon URL cannot be identified, then the returned URL is generated by the
input argument fallback
.
faviconLink
,
faviconIco
,
faviconDuckDuckGo
,
faviconGoogle