Exporting Your Bookmarks From Google Reader
Tue Jul 4, 14:19
Today I wanted to export my bookmarks from Google Reader so I could tag them in del.icio.us. I found that the easiest way to do it was to export my list of subscriptions to OPML and use Ruby's REXML library to extract the URLs that I wanted.
- First step, export your subscription list and save it as
~/greader.opml - Run this Ruby script from
~:require "rexml/document" opml = REXML::Document.new(File.new( 'greader.opml' )) #REXML lets you use an XPath expression to select elements, then iterate over them sites = opml.elements.map('opml/body/outline/outline') do |outline| [ outline.attributes['text'], outline.attributes['htmlUrl'] ] end File.open( 'bookmarks.html', 'w' ) do |output_file| output_file << '<html><body>' sites.uniq.sort.each do |site| output_file << "<a href='#{site[1]}'>#{site[0]}</a> <br/>" end output_file << '</body></html>' end - Now, you will have a file
~/bookmarks.htmlthat lists all of the websites that you had RSS/Atom feeds to in Google Reader.
I opened my bookmarks.html file in my browser and used the del.icio.us extension to tag them all, but you can use them however you like.
Enjoy!