Sep. 17th, 2011

davidn: (rant)
I'm not sure when or why this happened, but for the last while the front page of my site had been spitting out raw HTML where the journal entries used to be. It seemed as if the RSS feed had stopped including the characters that needed to be HTML-escaped, though the codes are definitely there when you look at it on Livejournal's side and I couldn't see why they weren't appearing any more when I tried to read it on my site.

I'm not sure what the cause was, but I finally got around it by changing from Magpie RSS, which is lovely and simple, to SimplePie, which is overengineered to an absolutely comical level. It seems to spend layers upon layers of code working through every possibility for every known version of every feed type, so that you have the convenience of using a function called "get_description" and it'll automatically detect whether you want the element called "description" or "content" or "bananas" or whatever it is.

Fortunately, for the specialist possibilities that it hasn't thought of in its 390KB list of if/else statements (like retrieving the number of comments for a Livejournal entry), it's just about possible to work out the route to get there manually by tracing your way down the functions. It does mean that this:

$item['lj']['reply-count'];

Has now been transformed into this:


$item->data['child']['http://www.livejournal.org/rss/lj/1.0/']['reply-count'][0]['data'];

But it's a relief to have a front page that actually looks finished again.

Expand Cut Tags

No cut tags

May 2020

S M T W T F S
     12
3456789
1011121314 15 16
171819 20 212223
24252627 28 2930
31      

Most Popular Tags

Style Credit

Page generated Jul. 22nd, 2025 06:44 am
Powered by Dreamwidth Studios