... using Blosxom to retrace my steps

tstigers.net - Home :: Entries :: Feeds :: Photos
February 2018
Sun Mon Tue Wed Thu Fri Sat

Mon, 26 Nov 2007

Creating RSS from HTML (2)

Been there, done the learning, got the T-shirt. I wrote a PHP script, part of which I adapted from something I found (so I didn't actually do all the learning ...), which reliably produces the XML data I need for an RSS feed. These data are the output of the script when it is called; additionally, the script writes this output to a separate file named "index.rss". Strangely, Firefox syntax highlighting (in source view) doesn't work for this latter file - although it does for the former, which is named "index.php". Firefox also displays both files correctly, the result looks just like what you get when you open any out-of-the-box feed in the browser.

Google Reader, however, doesn't like my 2 files - it recognises neither the feed title nor any items. What I get is a feed named "(title: unknown)" without items. The markup looks exactly like the markup of another feed I have which works perfectly fine with Google Reader.

Might there be anything the matter with file headers which I don't understand? I just don't get it at all!

Posted on 26 Nov 2007 at 20:30 in /technology/internet. -- Permalink

Creating an RSS feed from an HTML file

I was rather surprised to find that PHP does not offer ready-made functions for parsing HTML, something similar to simplexml etc. for XML. OK, it's not so difficult to read an HTML file and hack it to pieces with regular expressions. But still ...

First of all, in order to get something to display for all 6 boxes on my new feeds page, I wrote an RSS file by hand for my photo galleries. This does the trick - but of course it would be so much nicer if I didn't need to update more than one file when I add another photo gallery. A PHP script should take this one file and produce a corresponding XML file whenever it is called.

Obviously, the perfect solution would be a PHP script which looks at the photo galleries directory and produces both an RSS feed and an "index.html" file on the fly. PHP has nice file functions! Yet where would the title of each feed item come from? Anyhow, for now I still have plenty to learn from trying to extract the relevant information from an HTML file and embed it in an XML file.

Posted on 26 Nov 2007 at 16:29 in /technology/internet. -- Permalink

My old laptop

That's an ancient Toshiba Satellite 1800, running SuSE 10. It served me well during our Gütersloh years (when we were proud owners of a 56k modem), and especially when we were teachers at Tai An (the Windows XP part of my dual boot system - with Knoppix - crashed on our very first day in China; I went for Linux only: Xandros, later Kanotix, finally SuSE). In Tai An we had our first broadband connection and our computers were our windows to the world. Skype was new in those days.

I went back briefly to Windoze XP because it was preinstalled on the ThinkPad I've used for a year now. Then that too crashed - good riddance. Ubuntu was what I could install on the machine without any hassles, so that's what I went for. Have been 99% happy with it ever since. Wireless internet became a problem at some point, that's the only drawback. Except for the lack of something like Quicksilver, of course. But Windows? On my own computer? Only over my dead body. It's bad enough I have to put up with it at work.

I don't actually use my old laptop anymore - well, yes, occasionally, just for fun. I do, however, keep SuSE updated. It doesn't seem right to stop feeding the old workhorse. After all these years.

Posted on 26 Nov 2007 at 12:23 in /life. -- Permalink

Powered by Blosxom RSS feed: /index.rss