Denseman on the Rattis

Formerly known as the Widmann Blog

bloggingenIT

Two annoying blogs

As I hinted to in this blog posting, I’ve had problems with two RSS feeds that I process in the What Others Are Saying box on the right.

I had fixed them once, but I then upgraded to a new version a bit too quickly and lost my modifications. 🙁

So now I’ll post my changes here, so that they’re saved for posterity.

First of all, my beloved Phyllis insists on writing her titles in all-caps, which looks crap when mixed with other postings. This code takes care of this:

if (stristr($url, 'phylsblog'))
        $title = ucwords(strtolower($title));

Secondly, John Wells’s blog stores the date in the title field in a non-standard format, and the title in the description field:

if (stristr($url, 'phon.ucl.ac.uk')):
   $day = substr($title, 0, strpos($title, ' '));
   if (strlen($day) < 2)
      $day = '0' . $day;
   $month = substr($title, strpos($title, ' ')+1, 3);
   $month = $months[$month];
   $year = substr($title, strpos($title, ' ', 4)+1, 4);
   $issued = $year."-".$month."-".$day." 00:30:00";
   $title = $item['description'];
endif;

Leave a Reply

Your email address will not be published. Required fields are marked *