PTT RSS 聯播的 bug

February 2nd, 2007

PTT RSS 聯播的 bug

PTT 實業坊是台灣最大的 BBS 站。其 RSS 功能已經開放了好一陣子。

但是不知道為什麼,常常無法通過 RSS Validator。尤其是在 Feed 中有被刪除文章時,會出現錯誤訊息:

XML parsing error:<unknown>:284:23: not well-formed (invalid token)

但是單單閱讀其 feed 則又看不出個所以然。 試著用不同的 Validator 測試,發現問題是出在 PTT 的 atom 中偶而會藏有不應該出現的 (Unicode:0×0) 而無法成功被解析。

如果要用 PHP 解決的話,只要使用 str_replace(”\0″, “”, $feed) 把東西丟到火裡即可。

Entry Filed under: 網路

1 Comment Add your own

  • 1. wens  |  February 4th, 2007 at 10:14 am

    問題修好了~
    之前寫的方式不太對.

Leave a Comment

Required

Required, hidden

Powered by WP Hashcash

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

January 2009
S M T W T F S
« Aug    
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts

Copyright