10.4: Export Safari's RSS feeds to Firefox

Jul 14, '05 07:57:00AM

Contributed by: hypert

Tiger only hintFor years, the excellent Safari Bookmark Exporter (SBE) has let us export Safari bookmarks to a variety of other browsers/formats.

With Safari 2.0, we can also bookmark RSS feeds, but SBE does not convert Safari's RSS bookmark format (line breaks added for narrower display width):

<A HREF="feed://www.macosxhints.com/backend/geeklog.rdf"
  ADD_DATE="" LAST_VISIT="" LAST_MODIFIED="" 
  LAST_CHARSET="" ID="">macosxhints</A>
to Firefox's RSS bookmark format:
<A HREF="http://www.macosxhints.com/" ADD_DATE="1120650185" 
  LAST_MODIFIED="1120650188"
  FEEDURL="http://www.macosxhints.com/backend/geeklog.rdf"
  ID="rdf:#$LeIDs2">macosxhints</A>
Here's my workaround...

Use SBE to export bookmarks.html to your Desktop, your home directory, or wherever. Open a Terminal and cd to the directory where you saved bookmarks.html. Then run this perl code:

perl -e 'open(F, "bookmarks.html") or die "$!\n";\ 
@bm=<F>;\
close(F);\
open(F, ">bookmarks.html") or die "$!\n";\
foreach (@bm) {\
s/href="feed/feedurl="http/i;\
print F;\
}\
close(F);'
The resulting bookmarks.html file will now have Firefox-compatible RSS bookmarks. You can overwrite your existing Firefox bookmarks file (usually in ~/Library -> Application Support -> Firefox -> Profiles -> *) or use Firefox's bookmark importing feature. You might want to back up your existing Firefox bookmarks first, just in case!

This hint is based on my observations of these bookmark formats, not on "specs" for these formats. Someone with detailed knowledge of these formats might have another solution, but this certainly worked for me.

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050706075745579