public
Description: Marginal hacks of no import
Homepage:
Clone URL: git://github.com/neurobashing/Quickies.git
J. Gregg Thomason (author)
Tue Nov 24 11:07:17 -0800 2009
Quickies / bookmarkimport.rb
100755 27 lines (21 sloc) 0.535 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/ruby
# -*- tab-width: 2 -*-
 
require 'rubygems'
require 'xml'
require 'appscript'
include Appscript
 
yj = app('Yojimbo')
 
bmfile = XML::Document.file('Webnotes.xbel')
 
bookmarklist = bmfile.find('//bookmark')
 
bookmarklist.each do |bookmark|
  yjbm = yj.make(:new => :bookmark_item)
  yjbm.location.set(bookmark.attributes['href'])
  bookmark.each_child do |child|
    if child.name == "title"
        yjbm.name.set(child.content)
    end
    if child.name == "desc"
      yjbm.comments.set(child.content)
    end
  end
end