You are not logged in.
SimplePie support has moved to Yahoo! Groups, and bug tracking has moved to bugs.simplepie.org. This support site will remain available as a read-only archive for the foreseeable future.
Example code:
<?php echo $feed->get_feed_link(); ?>"><?php echo $feed->get_feed_favicon(); ?></a>
Example output: Too much pie could kill you, by...
SimplePie could save your life, by...
Needs some CSS but you could make a pretty list, combining feeds from several sites to show the post, with a favicon for attribution.
Waddaya think?
Offline
That's a good idea. That information isn't in the feed though. Hmmm, we could:
1) Figure out where the feed is _really_ coming from (feedburner can be a problem, although SP already resolves the feed's real URL)
2) Figure out the domain name, and look for /favicon.ico. If it exists, cache it (since it's not likely to change often).
3) If the domain name is a subdomain, and no favicon exists, move up one subdomain, and look again (rss.xml.domain.com -> xml.domain.com -> domain.com).
4) Cache filename will be a md5'd version of the feed's domain name, to make it easy (and faster) for SimplePie to retrieve it.
This will probably go into 1.1 (since we're pretty much closed on 1.0 features).
Offline
Actually this does work:
<img src="<?php echo $feed->get_feed_link(); ?>/favicon.ico" alt="favicon" />
Returns:
<img src="http://www.bioneural.net/favicon.ico" alt="favicon" />
I have it working in a WordPress template page here.
P.S. The author of the script in my previous post replied to my email, saying "What the code does is, given a URL, it figures out the favicon for that URL and returns the URL for the favicon. It doesn't actually download the favicon, it just checks for its existence and returns the URL on success. The URL can then be placed in your HTML." Sounds perfect, no?
Offline
Pretty close, yeah! ![]()
Offline
I have the code to find the source URL from the Google News feed :
$link = urldecode($item->get_permalink()); $id = substr(substr($link,strpos($link, 'http://',10)),0,strrpos(substr($link,strpos($link, 'http://',10)), 'cid')-1); }
(I use it to remove duplicates... the visitor only sees and click the redirected-by-Gnews URL)
Offline
There's already a function in SP that resolves the true feed home. Checking the local subdomain first (if any), and moving up the domain chain would be the most effective way of grabbing a favicon.
We've just decided to do a Beta 3 instead of a B2, Bugfix 1, so this will be wrapped into that release, probably as the both of you have described above. We'll likely go a bit more in-depth for the 1.0 release.
Offline
I'm not talking about feed home, but item home from the feed
like in :
http://simplepie.org/demo/?feed=http:// … t=rss#feed
Item links are : "http://news.google.com/news/url?sa=T&ct=us/3-2-0&fd=R&url=http://www.columbusdispatch.com/news-story.php%3Fstory%3D193794&cid=1107371944&ei=cNKWRIrvFoKuoQLOnIyOBg"
The code above return "http://www.columbusdispatch.com/news-story.php%3Fstory%3D193794"
Is there a function like this in SP ? 80
Last edited by Malaiac (19 June 2006 09:37:37)
Offline
No, there's not. It would most likely pull the favicon for google news, but not the other site.
Offline
FYI, I found and acceptable cosmetic fix for missing favicons in Firefox (see the "desert" section) that show as an ugly "X" with:
<img src="' . $feed->get_feed_link() . '/favicon.ico" alt="X" width="16" height="16" />
Offline