I wrote a simple plugin for DokuWiki that, writing [DIL] on a page, lets you see displayed the Daily Dilbert. It uses the DilbertDailyStrip RSS feed and SimpleXML.
I’ve written a similar plugin for WordPress.
The current version is 0.7 and you can download it here.
ChangeLog:
- Version 0.7: it fixes a small bug (thanks to Michael Klein);
- Version 0.6: it uses the new feedproxy.google.com feed (thanks to Casey);
- Version 0.5: now it uses DokuHTTPClient instead of CURL, removing a dependence and handling the proxy settings automatically;
- Version 0.4: now it uses SimpleXML and CURL;
- Version 0.3: fixed a small security weakness (credits to Andy Webber);
- Version 0.2: it does not use anymore NuSOAP but the PHP5 SOAP extension and it can read the optional proxy configuration of DokuWiki (without having to duplicate it internally);
- Version 0.1: it is based on a snippet written by Alessandro Battezzati (the snippet itself is also based on http://shupe-website.googlecode.com/svn/trunk/myAdmin/test/dilbert.php that uses NuSOAP through the DailyDilbert Web Service). The
syntax.phpfile is shipped with$proxyhost, $proxyportset as your server was behind a proxy: void them if you don’t have a proxy. With small changes, this plugin can be used for generic SOAP client operations as well (changetempuri.orgwith your own namespace).
Last update: 2009-02-09


Nice. Small tip: if you replace the soap_transport_http class with a wrapper around DokuWiki’s own HTTP client class, your plugin will automatically use the proxy settings from the main DokuWiki configuration. It will also loose the dependency on the CURL extension.
Thank you for your tip. I will try understand DokuWiki internals better for a future release of my small plugin.
Version 0.2 partially implements the tip suggested by Andreas.
Hello,
is there any way how can I make the -excellent- (thank you, thank you) Dilbert plugin scale the image in size or percentage?
Jakub
Jakub: the quick way is to change its code (it’s simple to do it) adding
width="95%"inside its img tag (95 or another percentage you like). The long way is: to wait a future release of my plugin with an option that could account this problem.The URL seems to have changed.. and the display has halted. Can you do a quick fix, please? Absolutely love this plugin !
Fixed it!
Change from:
http://feeds.feedburner.com/DilbertDailyStrip
To:
http://feedproxy.google.com/DilbertDailyStrip
That’s it.
Casey: it’s a sort of redirect. I’m going to release a new version with the new feed, thanks.
Hello Carlo,
thank you very much for the quick fix, having Dilbert back feels like being at home
What do you thing about publishing your Dilbert plugin via “current” URL? For example:
http://perassi.org/quickhacks/dkdil/cur/dil-current.tar.gz
This would make installation and further updates easier for the plugin users.
Jakub
p.s. the width=”XX%” works like charm, thank you for the tip!
Jakub: it’s not a bad idea… I haven’t set it because I still think that people who want to get news of this kind should subscribe to my feed… am I wrong?
Anyhow, I might add this feature in the next release.
I guess that you are right. Getting latest information is purpose of feeds. Nevertheless, easier wiki plugin upgrade is a nice thing to have O:-)
Hi,
I installed your plugin on the 2008-05-05 release, but all I get when I add [DIL] to a page is the “broken image link” icon and a link to this page with the text “DKDIL”. Any idea what’s going on?
Thanks!
Dave: it seems that your server wasn’t able to reach the remote feed or that the feed itself was not served during your test. Are you behind a proxy? If so, try setting it (see the DokuWiki manual or the backend interface) and let me know, even by email.
I notice that the strip displayed is the one that was current on the day the page that contains the [DIL] tag was last edited. It seems to me that the displayed strip should be updated every day, but the one displayed looks like it’s from the cache. Is this a Dokuwiki setup issue?
John: perhaps the odd behaviour you describe is due to some settings of your DokuWiki (like the cache, of course). There isn’t any cache command inside the plugin (which, like the WordPress version I’m using here, simply feeds, parses and shows the remote XML).
Thanx for this great plugin.
There’s a small typo in line 48: there’s no tag like “alt” for an anchor, so please replace this line:
$feed_contents .= ‘<a href="’ . $url . ‘/" alt="DIL">’ .
with:
$feed_contents .= ‘<a href="’ . $url . ‘/">’ .
Michael: you are right. It’s a typo that is contained only in the DokuWiki version of my plugin (the WordPress version is not affected). I’m going to fix it. Thanks.