Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Export Safari's RSS feeds to Firefox Web Browsers
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.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[15,794 views]  

10.4: Export Safari's RSS feeds to Firefox | 8 comments | Create New Account
Click here to return to the '10.4: Export Safari's RSS feeds to Firefox' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Export Safari's RSS feeds to Firefox
Authored by: jesboat on Jul 14, '05 11:23:56AM

The script has a few disadvantages: firstly, it's big and, secondly, because it tries to modify the file in-place, it has to load the entire bookmarks list into memory before it can modify and then re-write.

Perl has a few command-line options which can reduce it to:

[code]perl -p -i .orig -e 's/href="feed/feedurl="http/i' bookmarks.html[/code]

This will leave your original file as bookmarks.html.orig, and the modified version as bookmarks.html. If you don't want the backup, just remove the '.orig ' from the command line.

<disclaimer>I haven't tested this</disclaimer>, but it should work.

Jesboat

---
--
With no walls or fences on the 'net, who needs Windows or Gates?



[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: hypert on Jul 14, '05 12:17:59PM

Thanks! I don't usually do command-line Perl, so I didn't know it could be that compact. Cool. The essential substitution in both our codes was actually part of a larger Perl script that takes my Safari bookmarks and massively reformats them so the bookmarks (mostly) work the same on my Mac, our 4 PCs, and even my Solaris box. That script is very custom to my needs, but I thought this individual piece was worthwhile to share. Of course, then I read Zach's comments...

Oh well!



[ Reply to This | # ]
10.4: Export Safari's RSS feeds (and SafariStand's separators!) to Firefox
Authored by: hypert on Dec 29, '05 02:26:29PM
I recently wanted to update my bookmark-processing script to start handling the separators that are supported by SafariStand. (Bookmark Separators are such a great idea in any of the Mozilla browsers that I can't believe they're not officially supported by Safari!)

Anyway, I took jesboat's compact vesion of my bloated code and made a simple change to allow SafariStand's separators to be converted to Firefox-compatible separators:


perl -p -i.orig -e 's/href="feed/feedurl="http/i;s/.*HREF="-:-".*/<hr>/i' bookmarks.html
Hope that helps someone else, too, although I doubt many people will stumble across this old thread...

[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: zach on Jul 14, '05 12:09:03PM

Actually, there is a far, far easier way to do this if you are using Deer Park Alpha 2, an alpha preview release for what will eventually become Firefox 1.1:

1. Launch Deer Park a2
2. File->Import from Safari
3. There is no step three

Safari import is a new feature, and we'd appreciate your feedback (through bugzilla.mozilla.org) if you have any trouble.



[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: hypert on Jul 14, '05 12:22:55PM

Thanks - I will try it!



[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: Bladehawke on Jul 15, '05 04:22:51AM

While it *does* import Safari bookmarks just beautifully, it does not do what this hint does. RSS feeds (feed://) links are still feed:// which is still unsupported in Deer Park. The lack of support for feed:// is already a noted bug in bugzilla, and I would hesitate somewhat to call the fact that they don't munge feed:// into an equivalent http:// a bug.

feed:// is a fairly new protocol, and as such is not yet widely supported. I think fixing feed:// is more important.



[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: hypert on Jul 15, '05 08:24:19AM

I agree with Bladehawk. Firefox Deer Park A2 imported my Safari Bookmarks (nice!), but left feed:// URLs alone.

So, if you really want to covert RSS bookmarks (which is what this hint is about), use my method or jesboat's, until Firefox supports feed:// URLs or SBE gets updated.



[ Reply to This | # ]
10.4: Export Safari's RSS feeds to Firefox
Authored by: sameerd on Jul 14, '05 01:45:44PM
You can also look at this link http://www.macosxhints.com/article.php?story=20050613221526553 for exporting safari rss feeds into opml which can then be imported into firefox's sage extension.

[ Reply to This | # ]