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


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 | # ]