{"id":362,"date":"2002-05-10T15:32:09","date_gmt":"2002-05-10T20:32:09","guid":{"rendered":"http:\/\/www.ashleyit.com\/blogs\/brentashley\/?p=362"},"modified":"2002-05-10T15:32:09","modified_gmt":"2002-05-10T20:32:09","slug":"cleanse-rss-as-you-collect-it","status":"publish","type":"post","link":"https:\/\/ashleyit.com\/blogs\/brentashley\/2002\/05\/10\/cleanse-rss-as-you-collect-it\/","title":{"rendered":"cleanse RSS as you collect it"},"content":{"rendered":"<p><a href=\"http:\/\/kosmo.com\/blogs\/TimsBlog\/\">Tim&#8217;s<\/a> been doing some programming with RSS and learning a thing or two.<\/p>\n<p>Not to get behind, I&#8217;m working with <a href=\"http:\/\/radio.weblogs.com\/0103807\/\">Scott Johnson<\/a> on some RSS stuff and wrote a test harness for a routine to clean up the descriptions in a feed, removing or escaping html, truncating description size, etc.<\/p>\n<p>I&#8217;ve been following the <a href=\"http:\/\/radio.weblogs.com\/0100887\/2002\/05\/07.html#a222\">debate<\/a> about whether <a href=\"http:\/\/www.theshiftedlibrarian.com\">Jenny <\/a>should truncate her feed., so it occurs to me it doesn&#8217;t matter any more whether she does or not.  As long as I use my new handy-dandy <a href=\"http:\/\/www.ashleyit.com\/utils\/src_cleanseRSS.php\">RSS cleansing proxy<\/a>, I can control it myself.<\/p>\n<p>I&#8217;ve saved a piece of Scott&#8217;s feed as an example since he&#8217;s got some html in it and his entries are long.  Here&#8217;s the <a href=\"http:\/\/www.ashleyit.com\/utils\/test.xml\">raw feed<\/a><\/p>\n<p>If you use my cleanser, you get <a href=\"http:\/\/www.ashleyit.com\/utils\/cleanseRSS.php?feed=http:\/\/www.ashleyit.com\/utils\/test.xml\">this result<\/a><\/p>\n<p>The feed parameter of course is required. I&#8217;ve added optional parameters too &#8211; <\/p>\n<p><b>limit<\/b> sets the byte limit to truncate the feed at, or 0 for all of it.  defaults to 500 bytes<\/p>\n<p><b>method<\/b> allows you to specify whether you want all tags removed from the feed (remove) or just have ampersands escaped so it doesn&#8217;t mess up your aggregator output or cause script security concerns (amp).  Defaults to remove.<\/p>\n<p>More examples: <a href=\"http:\/\/www.ashleyit.com\/utils\/cleanseRSS.php?limit=50&#038;feed=http:\/\/www.ashleyit.com\/utils\/test.xml\">limit to 50 bytes<\/a>,  <a href=\"http:\/\/www.ashleyit.com\/utils\/cleanseRSS.php?method=amp&#038;feed=http:\/\/www.ashleyit.com\/utils\/test.xml\">amp method<\/a><\/p>\n<p>I&#8217;ll leave this available for a day or two, but after that, you&#8217;ll have to do it yourself &#8211; I don&#8217;t need the entire world&#8217;s RSS calls proxied through my server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tim&#8217;s been doing some programming with RSS and learning a thing or two. Not to get behind, I&#8217;m working with Scott Johnson on some RSS stuff and wrote a test harness for a routine to clean up the descriptions in a feed, removing or escaping html, truncating description size, etc. I&#8217;ve been following the debate [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-blather"],"_links":{"self":[{"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":0,"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"wp:attachment":[{"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ashleyit.com\/blogs\/brentashley\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}