Hi
For any given site "example.domain.tld" or merely "domain.tld" I need to do the following in PHP:
- If the site has a favicon, get it wherever it is
- If it is not already a PNG, convert it to PNG
- Save it to /favicons/example.domain.tld.png
- If the site has no favicon, do nothing.
Any ideas? I'm being stumped by the unreliable fileformat and location of the favicons, but if at all possible I want to avoid downloading the entire source of the page with file_get_contents in order to find it in the headers. Also converting to png seems nontrivial.
Thanks,
Mala