Andreas Gohr | 2 Feb 2009 22:16
Favicon
Gravatar

Re: me and feedparsing - next question

> I rewrote the plugin mentioned in my last mail and wrote a new one
> including SimplePie.php. Works great, only that I want the Dilbert daily
> cartoon now, and feedburner dislikes SimplePie... Took a while until I
> got it working, but it runs nearly fine now.

First of all, you are aware of http://www.dokuwiki.org/plugin:dil, right?

Now let's see.

1) Don't use SimplePie directly but use the FeedParser wrapper:

require_once(DOKU_INC.'inc/FeedParser.php');
$feed = new FeedParser();
$feed->set_feed_url($url);

It ensures DokuWiki's HTTPClient is used which itself make use of the
correct proxy settings.

2) $item->get_permalink() returns a link to the Website the cartoon is
displayed on. Not the image address. You probably want to parse the
IMG src attribute from the item description.

3) '[[http://dilbert.com/|{{http://feedproxy.google.com/~r/DilbertDailyStrip/~3/3Ds_eCGi5XM/}}]]'.
will not be recognized as image even if it would be an image. See
http://www.dokuwiki.org/images#dynamic_images

4) passing DokuWiki syntax to a new  p_render() call is very expensive
and shouldn't be done except absolutely necessary. Call
$renderer->externalmedia() instead.

Andi

-- 
splitbrain.org
--

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist


Gmane