<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: movabletype code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 03:07:02 GMT</pubDate>
    <description>DZone Snippets: movabletype code</description>
    <item>
      <title>Export del.icio.us links to MT Import Format</title>
      <link>http://snippets.dzone.com/posts/show/3396</link>
      <description>A friend of mine needed his del.icio.us links in MT Import format for some reason. This solved that problem.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;require 'rexml/document'&lt;br /&gt;require 'net/https'&lt;br /&gt;require 'rubygems'&lt;br /&gt;&lt;br /&gt;# change credentials!&lt;br /&gt;user = 'username'&lt;br /&gt;pass = 'password'&lt;br /&gt;&lt;br /&gt;# User-Agent: required for del.icio.us api&lt;br /&gt;agent = 'delicious-mt'&lt;br /&gt;xml = ''&lt;br /&gt;&lt;br /&gt;http = Net::HTTP.new('api.del.icio.us', 443)&lt;br /&gt;http.use_ssl = true&lt;br /&gt;http.start do |http|&lt;br /&gt;  request = Net::HTTP::Get.new('/v1/posts/all', {'User-Agent' =&gt; agent})&lt;br /&gt;  request.basic_auth(user, pass)&lt;br /&gt;  response = http.request(request)&lt;br /&gt;  response.value&lt;br /&gt;  xml = response.body&lt;br /&gt;end&lt;br /&gt; &lt;br /&gt;REXML::Document.new(xml).elements.each('posts/post') do |el|&lt;br /&gt;  puts "TITLE: #{el.attributes['description']}"&lt;br /&gt;  puts "AUTHOR: Author Name"&lt;br /&gt;  puts "DATE: #{DateTime.parse(el.attributes['time']).strftime("%m/%d/%Y %H:%M:%S")}"&lt;br /&gt;  puts "-----"&lt;br /&gt;  puts "BODY:"&lt;br /&gt;  puts el.attributes['extended']&lt;br /&gt;  puts "-----"&lt;br /&gt;  puts "EXCERPT:"&lt;br /&gt;  puts el.attributes['href']&lt;br /&gt;  puts "KEYWORDS:"&lt;br /&gt;  puts el.attributes['tag']&lt;br /&gt;  puts "-----"&lt;br /&gt;  puts "--------"&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 31 Jan 2007 18:36:51 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3396</guid>
      <author>jnewland (Jesse Newland)</author>
    </item>
    <item>
      <title>Movable Type Navigation</title>
      <link>http://snippets.dzone.com/posts/show/1521</link>
      <description>This will generate nested unordered lists of links to all category and sub-category archives that are descendants of the "Articles" category, but not a link to the "Articles" category itself. Requires the wonderful &lt;a href="http://www.staggernation.com/mtplugins/Compare/"&gt;Compare&lt;/a&gt; plugin.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;MTSubCategories&gt;&lt;br /&gt;&lt;MTIfIsDescendant parent="Articles"&gt;&lt;br /&gt;&lt;MTIfEqual a="[MTCategoryLabel]" b="Articles"&gt;&lt;br /&gt;&lt;MTSubCatsRecurse&gt;&lt;br /&gt;&lt;MTElse&gt;&lt;br /&gt;&lt;MTSubCatIsFirst&gt;&lt;ul class="leftnav"&gt;&lt;/MTSubCatIsFirst&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;&lt;a href="&lt;MTCategoryArchiveLink$&gt;" title="&lt;$MTCategoryDescription$&gt;"&gt;&lt;$MTCategoryLabel$&gt;&lt;/a&gt;&lt;MTSubCatsRecurse&gt;&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;&lt;MTSubCatIsLast&gt;&lt;/ul&gt;&lt;/MTSubCatIsLast&gt;&lt;br /&gt;&lt;/MTElse&gt;&lt;br /&gt;&lt;/MTIfEqual&gt;&lt;br /&gt;&lt;/MTIfIsDescendant&gt;&lt;br /&gt;&lt;/MTSubCategories&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 18 Feb 2006 04:18:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1521</guid>
      <author>jnewland (Jesse Newland)</author>
    </item>
  </channel>
</rss>
