Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix a macosxhints/AmphetaDesk RSS glitch UNIX
I read macosxhints' rss offering using AmphetaDesk, and if any of the current hints mention Exposé or otherwise use non-ASCII characters, I get an error from AmphetaDesk because of an illegal character in the XML file. I used to go in by hand and delete or modify the illegal character, but I got tired of that, and now I simply run the following script from a Terminal window and reload the browser page, and it works. Note that it changes non-ascii characters to dashes (-). I call the script fixrss.
#!/bin/sh

tr '\200-\377' '-' < $HOME/Applications/amphetadesk-osx-v0.93.1/data/
 channels/macosxhints.xml > /tmp/fixrss$$
cp /tmp/fixrss$$ $HOME/Applications/amphetadesk-osx-v0.93.1/data/
 channels/macosxhints.xml 
rm -f /tmp/fixrss$$
NOTE: The tr and cp lines have been broken into two for narrower display; remove the line break when entering this code.

[robg adds: If anyone knows RSS coding and would like to help fix the macosxhints' feed, please email me privately -- this is definitely an issue with the feed at present!]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,521 views]  

Fix a macosxhints/AmphetaDesk RSS glitch | 4 comments | Create New Account
Click here to return to the 'Fix a macosxhints/AmphetaDesk RSS glitch' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix a macosxhints/AmphetaDesk RSS glitch
Authored by: visigothe on Jun 29, '04 11:12:09AM

While I haven't looked at the RSS feed, you want to make sure that you are properly stating that the encoding of the RSS file is UTF-8 (and make sure you use UTF-8 to write the feed)

That should clear up any issues.



[ Reply to This | # ]
Fix a macosxhints/AmphetaDesk RSS glitch
Authored by: Lankhmart on Jun 29, '04 02:30:04PM

First, the feed claims to use UTF-8 encoding, but the text actually seems to be in latin-1 (or iso-8859-1) format. So match the declaration at the top of the XML to the real text encoding (or vice versa).

Second, the server is giving the feed a MIME type of "text/plain" when it really ought to be "application/rss+xml".

(As a point of reference: the feedvalidator made these issues easy to spot.)



[ Reply to This | # ]
Fix a macosxhints/AmphetaDesk RSS glitch
Authored by: gshenaut on Jun 29, '04 11:11:21PM
You know, I think that the underlying problem may be that the "Post a Comment" page has the item
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
in its header, which I think means that the text people enter in the text block will start out as iso, not utf-8. So, the easiest thing would be to either change the rss header to match, or to filter the text on the rss page through something like
iconv -t utf-8 -f iso8859-1
BTW, after noticing this, I changed my fixrss script to do it that way, using iconv.

Greg Shenaut

[ Reply to This | # ]

shouldn't really be .rdf
Authored by: bentucker on Jun 29, '04 03:28:21PM

Okay, this is kind of nitpicky, but another thing is it really shouldn't be ".rdf". It's an RSS 2.0 feed which has nothing at all to do with rdf. If it were RSS 1.0 then the .rdf extension would make sense. If an extension is desired, .xml or .rss would be better choices... all that said, it really doesn't matter :)



[ Reply to This | # ]