<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: osa code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 22:10:06 GMT</pubDate>
    <description>DZone Snippets: osa code</description>
    <item>
      <title>Archive Flagged Items from NetNewsWire into Yojimbo</title>
      <link>http://snippets.dzone.com/posts/show/5001</link>
      <description>This lil Ruby-OSA script will allow you to import your "Flagged Items" in NetNewsWire as Web Archive Items in Yojimbo. Thus allowing you to save RSS articles for off-line viewing/storage.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/local/bin/ruby&lt;br /&gt;['rubygems', 'rbosa'].each {|lib| require lib}&lt;br /&gt;nnw = OSA.app('NetNewsWire')&lt;br /&gt;yojimbo = OSA.app('Yojimbo')&lt;br /&gt;&lt;br /&gt;nnw.subscriptions.find { |s| s if s.display_name == 'Flagged Items' }.headlines.each do |article|&lt;br /&gt;  unless yojimbo.web_archive_items.map { |f| f.source_url }.include?(article.url)&lt;br /&gt;    archived = yojimbo.make(OSA::Yojimbo::WebArchiveItem, &lt;br /&gt;                            article.url, &lt;br /&gt;                            :name =&gt; article.title)&lt;br /&gt;    # Adjust this for slower/faster bandwidth connections (or your feeling lucky, punk)&lt;br /&gt;    sleep(5)&lt;br /&gt;    # Uncomment below to remove the flagged items upon successfully archiving&lt;br /&gt;    # if archived.name == 'untitled' &amp;&amp; archived.source_url.empty?&lt;br /&gt;    #   puts "!!! #{article.title} does not look to be imported !!!"&lt;br /&gt;    # else&lt;br /&gt;    #   article.delete&lt;br /&gt;    # end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 18 Jan 2008 04:02:07 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5001</guid>
      <author>justinwr (Justin R)</author>
    </item>
  </channel>
</rss>
