{"id":1049,"date":"2008-01-27T22:34:05","date_gmt":"2008-01-28T06:34:05","guid":{"rendered":"http:\/\/cephas.net\/blog\/2008\/01\/27\/deliciousposter-102-released-and-fun-with-html-entities\/"},"modified":"2008-01-27T22:34:05","modified_gmt":"2008-01-28T06:34:05","slug":"deliciousposter-102-released-and-fun-with-html-entities","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2008\/01\/27\/deliciousposter-102-released-and-fun-with-html-entities\/","title":{"rendered":"deliciousposter 1.02 released and fun with html entities"},"content":{"rendered":"<p>I fixed a bug in <a href=\"http:\/\/cephas.net\/projects\/deliciousposter\/\">deliciousposter<\/a> that&#8217;s probably been wrecking havoc on anyone reading this site using an aggregator for a long time. You&#8217;re probably a nerd if you&#8217;re reading this post anyway, so I&#8217;ll bore you with the details.  The deliciousposter project uses the <a href=\"http:\/\/sourceforge.net\/projects\/delicious-java\/\">delicious java library<\/a> to get a list of posts from del.icio.us, creates a blog post using <a href=\"http:\/\/velocity.apache.org\/\">Velocity<\/a> (which is really nasty now that I&#8217;ve been using <a href=\"http:\/\/freemarker.org\/\">Freemarker<\/a> for the last year) and then uses the <a href=\"http:\/\/en.wikipedia.org\/wiki\/MetaWeblog\">MetaWeblog API<\/a> to publish the resulting blog post to a blog. So the data gets pushed to del.icio.us originally:<br \/>\n<code>Aaron&#8217;s Stuff &raquo; DeliciousPoster<\/code><br \/>\nreturned from del.icio.us in XML<br \/>\n<code>Aaron&amp;#8217;s Stuff &amp;raquo; DeliciousPoster<\/code><br \/>\nto the del.icio.us java library, which decodes the XML so that you again have this:<br \/>\n<code>Aaron&#8217;s Stuff &raquo; DeliciousPoster<\/code><br \/>\nbut then you post that using XML-RPC and you end up with something like this:<br \/>\n<code>Aaron?s Stuff ? DeliciousPoster<\/code><br \/>\nWhy? Because you need to escape any HTML entities before sending them along via XML-RPC, I used <a href=\"http:\/\/commons.apache.org\/lang\/\">Commons-Lang<\/a>, which has a <a href=\"http:\/\/commons.apache.org\/lang\/api\/org\/apache\/commons\/lang\/StringEscapeUtils.html\">utility for escaping HTML entities<\/a>:<br \/>\n<code>StringEscapeUtils.escapeHtml(yourstring)<\/code><br \/>\nThink that&#8217;s nerdy? Wait until you have to do the same thing with <a href=\"http:\/\/www.xn--8ws00zhy3a.com\/blog\/2006\/06\/encoding-rss-titles\">titles in RSS<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I fixed a bug in deliciousposter that&#8217;s probably been wrecking havoc on anyone reading this site using an aggregator for a long time. You&#8217;re probably a nerd if you&#8217;re reading this post anyway, so I&#8217;ll bore you with the details. The deliciousposter project uses the delicious java library to get a list of posts from &hellip; <a href=\"https:\/\/cephas.net\/blog\/2008\/01\/27\/deliciousposter-102-released-and-fun-with-html-entities\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">deliciousposter 1.02 released and fun with html entities<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23,32,10],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/1049"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}