<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Parsing a del.icio.us export with Hpricot</title>
	<atom:link href="http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/feed/" rel="self" type="application/rss+xml" />
	<link>http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/</link>
	<description>repeat 4[fd 100 rt 90]</description>
	<lastBuildDate>Tue, 17 Apr 2012 18:38:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Marq</title>
		<link>http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-57382</link>
		<dc:creator>Marq</dc:creator>
		<pubDate>Fri, 27 Aug 2010 02:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-57382</guid>
		<description>Hey Soledad, 

Thanks for pointing out the next.name thingy with Hpricot... I didn&#039;t want to waste more than an hour to parse my delicious bookmarks, and I almost ended up taking sed to the bookmarks HTML file so that I could add the title as an attribute within the &lt;A&gt; instead of the next DD thing. I&#039;m pretty sure Yahoo isn&#039;t giving us a nice XML document because it fears people will move away to other services such as Google bookmarks---which is exactly what I&#039;m planning to do.

Anyway, if you don&#039;t like the if/else loops, you can just do something like the following for the same result:

(doc/&quot;dl/dt&quot;).each do &#124;bkmk&#124;
  link = (bkmk/&quot;a&quot;)
  b = Hash.new
  b[:title] = link.inner_text
  b[:url] = link.attr(&#039;HREF&#039;)
  b[:tags] = link.attr(&#039;TAGS&#039;).split(&quot;,&quot;) if link.attr(&#039;TAGS&#039;)
  b[:created_at] = link.attr(&#039;ADD_DATE&#039;)
  b[:description] = bkmk.next.inner_text if bkmk.next.name == &#039;dd&#039;

  bookmarks &lt;&lt; b

end</description>
		<content:encoded><![CDATA[<p>Hey Soledad, </p>
<p>Thanks for pointing out the next.name thingy with Hpricot&#8230; I didn&#8217;t want to waste more than an hour to parse my delicious bookmarks, and I almost ended up taking sed to the bookmarks HTML file so that I could add the title as an attribute within the <a> instead of the next DD thing. I&#8217;m pretty sure Yahoo isn&#8217;t giving us a nice XML document because it fears people will move away to other services such as Google bookmarks&#8212;which is exactly what I&#8217;m planning to do.</p>
<p>Anyway, if you don&#8217;t like the if/else loops, you can just do something like the following for the same result:</p>
<p>(doc/&#8221;dl/dt&#8221;).each do |bkmk|<br />
  link = (bkmk/&#8221;a&#8221;)<br />
  b = Hash.new<br />
  b[:title] = link.inner_text<br />
  b[:url] = link.attr(&#8216;HREF&#8217;)<br />
  b[:tags] = link.attr(&#8216;TAGS&#8217;).split(&#8220;,&#8221;) if link.attr(&#8216;TAGS&#8217;)<br />
  b[:created_at] = link.attr(&#8216;ADD_DATE&#8217;)<br />
  b[:description] = bkmk.next.inner_text if bkmk.next.name == &#8216;dd&#8217;</p>
<p>  bookmarks &lt;&lt; b</p>
<p>end</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sole</title>
		<link>http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-49411</link>
		<dc:creator>sole</dc:creator>
		<pubDate>Fri, 28 Mar 2008 17:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-49411</guid>
		<description>Hey thanks! :-)

although it&#039;s not that funky, it&#039;s just a mix of everything, and it&#039;s funny!</description>
		<content:encoded><![CDATA[<p>Hey thanks! :-)</p>
<p>although it&#8217;s not that funky, it&#8217;s just a mix of everything, and it&#8217;s funny!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-49410</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Fri, 28 Mar 2008 16:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://soledadpenades.com/2008/03/25/parsing-a-delicious-export-with-hpricot/#comment-49410</guid>
		<description>Soledad,

Thank you for sharing your examples of using Hpricot. Your examples save me much time learning Hpricot&#039;s &quot;funky&quot; syntax.

--Wayne</description>
		<content:encoded><![CDATA[<p>Soledad,</p>
<p>Thank you for sharing your examples of using Hpricot. Your examples save me much time learning Hpricot&#8217;s &#8220;funky&#8221; syntax.</p>
<p>&#8211;Wayne</p>
]]></content:encoded>
	</item>
</channel>
</rss>

