I was using Kouhei Sutou‘s rss lib to parse and generate a rss feed, it was running very well until I stuck with setting the CDATA value to description field. On Kouhei’s webpage it was said this lib started support content:encoded syntax since version 2.11. But my test found that it can read CDATA, not setting.
Emailed to Kouhei directly, got response pretty fast: I can’t do that.
OK, Ruby is too new to those stuff. I had to turn to php then.
The only glitch in feed generator is the default value of encoding, I had to hatch into its class module to change channel.encoding, the outside operation doesn’t work.
To set the CDATA using feed generator, syntax look like this:
$item->description = “asdfasfasf<br />asdfasdfa<br />”;
$item->descriptionHtmlSyndicated = true;
The generated rss xml will be:
<description><![CDATA[asdfasfasf<br />asdfasdfa<br />]]></description>
I have another problem using lastRSS, the fopen(rss_url) method only works locally, not on my DH shared host, maybe the allow_url_open is off by default on DH? I didn’t spend too much time on it because I switched to curl to work around immediately. I will look into this setting later.
LastRSS does not support ATOM, so I use famous MagpieRSS instead for an ATOM feed. There is only one thing I don’t like MagpieRSS is, it only reads feed from url, while lastRss can read both from url and file.