DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Archive Flagged Items From NetNewsWire Into Yojimbo
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.
#!/usr/local/bin/ruby
['rubygems', 'rbosa'].each {|lib| require lib}
nnw = OSA.app('NetNewsWire')
yojimbo = OSA.app('Yojimbo')
nnw.subscriptions.find { |s| s if s.display_name == 'Flagged Items' }.headlines.each do |article|
unless yojimbo.web_archive_items.map { |f| f.source_url }.include?(article.url)
archived = yojimbo.make(OSA::Yojimbo::WebArchiveItem,
article.url,
:name => article.title)
# Adjust this for slower/faster bandwidth connections (or your feeling lucky, punk)
sleep(5)
# Uncomment below to remove the flagged items upon successfully archiving
# if archived.name == 'untitled' && archived.source_url.empty?
# puts "!!! #{article.title} does not look to be imported !!!"
# else
# article.delete
# end
end
end






Comments
Js Jullia replied on Thu, 2012/07/12 - 9:37am
Snippets Manager replied on Wed, 2007/05/16 - 7:54pm