Serendipity and Feed Problems
Sunday, June 29. 2008
This site uses a blogging platform called serendipity which is a nice little tool and I've been mostly happy since moving across from textpattern (I did write about the experience). Recently however, a few things have been going wrong with the feeds.
I edited an old post, because the image links were broken (I did have a nightmare migrating because I was so inconsistent about the format of the image tags in textpattern, completely my own fault). I was very careful not to update the published date of the article, however the edited article appeared in the feed, which wasn't what I had in mind! It turned out that this is by design. On line 262 of includes/functions_entries.inc.php (I have serendipity 1.1.3), I found this:
$cond['orderby'] = 'last_modified DESC';
I've commented out this line, which was in an if($modified_since) clause. Hopefully this will stop updated entries from appearing in the feed - I have a few other old ones to fix images in so we'll soon see.
At around the same time, Ivo mentioned that he was seeing the order of posts change in his reader (google reader) when people commented on my posts. I suspect that this is part of the same issue and I'm optimistic of it also being fixed by this change. However when I was looking into the problem I noticed that the URL he was using to access my feed, http://www.lornajane.net/index.rss2, actually returned RSS 0.91. Not ideal! The problem is the rewrite rule in serendipity's .htaccess file, which looks like this:
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
When you request index.rss2 it should rewrite to rss.php?file=$1&ext=$2 but the "rss" matches first so the user gets redirected to index.rss instead. As a nasty hack to get around this I removed the rss from the above example and gave it a line of its own:
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss) rss.php?file=$1&ext=rss
Requests to index.rss2 are now correctly rewritten as rss.php?file=index&ext=rss2 and will get RSS 2.0 format in the response. I have just noticed however that this is the most requested page on the site so I really hope I didn't break anything!
I edited an old post, because the image links were broken (I did have a nightmare migrating because I was so inconsistent about the format of the image tags in textpattern, completely my own fault). I was very careful not to update the published date of the article, however the edited article appeared in the feed, which wasn't what I had in mind! It turned out that this is by design. On line 262 of includes/functions_entries.inc.php (I have serendipity 1.1.3), I found this:
$cond['orderby'] = 'last_modified DESC';
I've commented out this line, which was in an if($modified_since) clause. Hopefully this will stop updated entries from appearing in the feed - I have a few other old ones to fix images in so we'll soon see.
At around the same time, Ivo mentioned that he was seeing the order of posts change in his reader (google reader) when people commented on my posts. I suspect that this is part of the same issue and I'm optimistic of it also being fixed by this change. However when I was looking into the problem I noticed that the URL he was using to access my feed, http://www.lornajane.net/index.rss2, actually returned RSS 0.91. Not ideal! The problem is the rewrite rule in serendipity's .htaccess file, which looks like this:
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
When you request index.rss2 it should rewrite to rss.php?file=$1&ext=$2 but the "rss" matches first so the user gets redirected to index.rss instead. As a nasty hack to get around this I removed the rss from the above example and gave it a line of its own:
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss) rss.php?file=$1&ext=rss
Requests to index.rss2 are now correctly rewritten as rss.php?file=index&ext=rss2 and will get RSS 2.0 format in the response. I have just noticed however that this is the most requested page on the site so I really hope I didn't break anything!
(Page 1 of 1, totaling 1 entries)

Comments
Wed, 27.08.2008 10:19
If it’s anything like the Asus that I have, then it should b e relatively easy to put Ubuntu on it, like I’ve done with m ine. Put installer on to a bootable USB stick…
Wed, 27.08.2008 08:50
It should be possible to automatically close down the wifi c onnection and unload the kernel module on hibernate. Look a t the scripts in /etc/apm/suspend.d for example. /etc/de fault/acpi-support might also have some options to get you s omewhere. I put my normal ethernet driver module (e100 [...]
Tue, 26.08.2008 14:56
Vid: Thanks for dropping by, I’m very pleased to hear you fo und this useful.
Tue, 26.08.2008 14:54
dotjay: Shared offices are OK, but I do like the peace and quiet of not sharing I must say. I get a bit loopy though i f I stay home for too long! The offline time trick is a goo d one – I like to at least turn off the monitor and use a pe n sometimes.
Mon, 25.08.2008 20:00
I’m so glad that you settled into telecommuting so well. As you know, I’ve been working for myself and/or telecommuting for the last five years. I’ve never really had the experienc e of a shared office, but I do use Skype a lot, sometimes ta lking with work mates for hours at a time. The trick i [...]
Sun, 24.08.2008 23:25
Lorna, Great post, found this via Chris’s blog, more tool s in my toolset now :). Thanks
Sat, 23.08.2008 20:46
shaun: I didn’t anticipate problems, I just didn’t think it worked in that way – but I’m completely happy to be told oth erwise :) Don’t be surprised that curl lets you do weird an d wonderful things, lots of tools are like that and it allow s you to use them in ways that the original author had [...]
Sat, 23.08.2008 10:21
ok, I’ve been experimenting with this, ‘switch’ing on the RE QUEST_METHOD to implement post, get, put, delete for a db r esource; so far I’ve not had problems using $SERVER[‘QUERY STRING’] and parse_str()... what problems do you anticipate? (I’m not sending files, everything fits in the string [...]
Fri, 22.08.2008 09:20
The main conference site is now live, and the call for paper s is open – see http://conference.phpnw.org.uk/phpnw08/