Export Safari RSS feeds via OPML

safari rss
I wrote a little shell script to export ‘s RSS feeds as an OPML file. This enabled me to import my list of feeds into other News Aggregators.

Update: I have also created an Automator Applicaton, so that the opml file can be created by just doubling clicking.

Usage

Click here to download the Automator Application – Just double click and a Safari.opml file will be created on the desktop containing all your feeds.

Click here to download the shell script – You might need to right click and then save it somwhere.
ExportRss2Opml.sh

To get the OPML bookmarks, go to the directory where you saved the script and run sh ExportRss2Opml.sh > safari.opml in the Terminal.

The file safari.opml will be an opml file containing your Safari feeds. I have tested the script by importing the resulting opml file into bloglines and Firefox’s Sage extension. Your mileage may vary. Let me know if you have any problems or comments.

Notes

Versions

  • Automator Version 1.2
    Shell Script Version 1.2 (Oct 19 2005)

    • Created an automator version. Just double click and it will create a Safari.opml file for you on the Desktop.
    • Released the code into the public domain
  • Version 1.1 (Jun 18 2005)
    • Escaped more special characters in the title field
  • Version 1.0
    • Hmm, maybe I would have saved more time if I had done it manually

47 Responses to “Export Safari RSS feeds via OPML”

  1. D’Arcy Norman Dot Net » Blog Archive » Blogroll Export from Safari 2 Says:

    [...] 7th, 2005, 4:57 pm Thanks to a pointer from Sameer D’Costa, I just used a handy shell script to export all of my Safari RSS subscriptions to an [...]

  2. Somah.com Says:

    Export Safari Bookmarks into OPML

    If you were looking for a way to export your Safari RSS feeds in a standard format (OPML) that is easily imported into other feed aggregators, you should stop looking cause Sameer D’Costa wrote a shell script that will do that for you …

  3. Berko Says:

    Thanks for writing this! I realized that using Safari as an RSS reader turns it into a memory hog. When I switched to NNW, I found your script and it worked fabulously! Thanks!

  4. themacgeek Says:

    What a great script and the Automator action is incredible! Way to go! Thanks.

  5. Test Blog » Blog Archive » Automator actions Says:

    [...] Automator is quite a cool component ofTiger. I upgraded my little Export RSS feeds from Safari shell script to an automator action. This is quite handy for the hordes of MacOSX users that abhor Terminal.app. All you need to do is double click the downloaded file and your feeds appear in a file on the Desktop, ready to be sent to any other feed reader. No need to open the terminal and worrying about redirecting shell script output. [...]

  6. Test Blog » Blog Archive » Stop the presses Says:

    [...] A shell script I wrote earlier got mentioned in the December issue of Macworld. It is hard to find the mention, but it is there. I wrote the script to move my feeds from Safari RSS to Bloglines. Last month, I upgraded the shell script to an Automator action, so you do not need to open Terminal.app if you do not want to. The article is a bit incorrect about that point, but I guess it was written a while ago. [...]

  7. UltimateLibrarian Says:

    anyone know anything about getting this to work for wordpress.com? i downloaded the app, got the opml file on my desktop, did the find and replace, but when i try to import it using my link manager, it gave the following message: XML error: no element found at line 1

    any ideas?

  8. Sameer Says:

    I got the same error message when I tried to upload my opml using safari. However, the error message disappeared when I put the opml file on my webserver and then asked wordpress.com to import it from there. Go figure!!

  9. Adam Saunders Says:

    This automator script is great for exporting to an OPML file. Do you know of an automator script for exporting Safari bookmarks and rss feeds to firefox? The basic script is described a the below URL, however I’m not not savvy enough to implement it.
    http://www.macosxhints.com/article.php?story=20050706075745579

    Any advice would be appreciated.

    -Adam

  10. Adam Saunders Says:

    Okay, I implemented it. The description was a little confusing on OSX Hints, so I wrote up a simpler explaination here: http://www.marketanomaly.com/?p=171

  11. D Says:

    You are a life saver! This automater has made Blogroll useful. I never bothered updating it because it was such a pain. Now all I have to do is export my current list of RSS addictions using your nifty app, then empty my Blogroll and upload the OPML. Tada! A current list shows up on my blog for the first time in ages. Thank you again.

  12. The Safari RSS experiment over for now | brilliantdays.com Says:

    [...] One little problem was how to get the feeds I have in Safari over to NetNewsWire, but Google fixed that in 2.3 seconds: Sameer D’Costa had a solution which worked fine. All feeds came over as “Untitled source”, but a quick refresh put their names and favicons back in place. [...]

  13. Hans Fugal Says:

    I can’t get this to work in flock. Is this flock’s problem or is there something wrong with the output?

  14. Flock Says:

    [...] I have a couple of major gripes. It imported my Safari settings only after I explicitly asked it to, and then it failed to do anything useful with my RSS feeds from Safari. Talk about a wet blanket. So I figured out how to create OPML from Safari and tried to import it. Flock failed to import it. Strike two. So then I decided to try the built-in blogging fun, and I’m not impressed with the stupid editor. Composing blog entries in what is basically the same interface as Netscape Composer ten years past is not my idea of cutting edge. I should have the option of starting out in source mode, but more importantly (since editing HTML is even less fun than using a composer-like interface) I should be able to use Markdown or Textile or whatever I want. I’ll still be using flog for writing my posts. [...]

  15. dr. Zoiberg Says:

    I can’t get this to work with Flock either :-(

  16. Mo Says:

    hey,

    The Automator app works great. I’ve looked at the OPML file under TextEdit and I can see all the links there.

    The reason, dr. Zoiberg, cannot get this to work with Flock is due to some funny problem with the way the app imports OPML files.

    The problem isn’t with your script. It works perfectly.

  17. Code Kitchen Says:

    I modified the Automator workflow slightly so that the OPML file can be imported into Flock. Yeah, it’s really Flock’s fault, but still… Anyway, here it is, mostly Sameer’s work anyway so it’s in the public domain as well, for anybody who finds this blog entry via Google like I did –

    http://thechef.codekitchen.net/SafariOPML2.dmg

  18. dr. Zoiberg Says:

    Thanks Code Kitchen!
    I’ll try importing right now

  19. Export Safari RSS to Flock Says:

    [...] I modified Sameer D’Costa’s Automator script for exporting Safari RSS feed bookmarks so that Flock will recognize and import the feeds. This is almost certainly a bug in Flock, but the OPML format seems to have a lot of different ways to do the same thing so just by tweaking the output format I got it to work fine. [...]

  20. fime | script to export your safari RSS feeds into a opml file Says:

    [...] read more | digg story [...]

  21. Chris Says:

    Hi,

    I seem to be the only one here who’s attempt isn’t working. When I run the script, or the Automater app, all I get is an OPML file with all the correctly formated XML/OPML, but no feeds included.

    I have my feeds in a “Feed” folder in the Bookmark Bar (they’re organized in subfolders)… I tried moving the folder into the main Bookmarks Menu as well as the bookmark screen sidebar with the same effect. The feeds *do* show up, obviously in Safaris ‘All Feeds’ screen in the Bookmarks and they work fine as I check them in Safari.

    Anyone with the same problem? Am i missing something?

    Thanks.

    Chris

  22. capillotraktor Says:

    Great app, thank you so much:-)

  23. Joe Says:

    I am having the same problem Chris. Maybe the 10.4.8 update broke something. Running a MacTel, if that makes a difference.

  24. zerstuckelung Says:

    LOL at Version 1.0… thanks for this, works like a charm.

  25. zoli Says:

    I can’t get it to work with Flock …

  26. In search of an RSS Feed Reader « iTouch Tips Says:

    [...] bookmarks to OPML”. From that search I found an Automator action written for this task at Test Blog. Once downloaded (its only 116k) I doubled clicked the Automator Action and it did its thing and [...]

  27. In search of an RSS Feed Reader Part 2 « iTouch Tips Says:

    [...] the former and imported the OPML file created from Part 1 using the little Automator script from Test Blog. With that done a pop-up is displayed and one is able to decide which feeds you would like to [...]

  28. Paul Says:

    Thanks for sharing. The application works great.

  29. Alex Says:

    I ran the automator file you created and just as you said it created a Safari.opml file on my desktop, but when I went to Google Reader and tried to load the file I was told file format not supported. Am I missing a step or something? Thanks for taking the time to make this and field questions.

  30. Gabriel Says:

    Works perfectly! All my Safari RSS bookmarks now Googled. Terrific, thank you!

  31. Ruud Says:

    Thanks!

  32. joe bofh Says:

    btw,

    this is incorrect, htmlurl != xmlurl, it is not correct to mindlessly substitute.

    htmlurl ideally would be the name of the website and xmlurl is the url to the feed.

  33. Steve Says:

    Awesome tool, but I don’t think it works with bloglines.

  34. shell script Says:

    [...] feeds as an OPML file. This enabled me to import my list of feeds into other News Aggregators. …http://dcostanet.net/wordpress/2005/06/13/export-safari-rss-feeds-via-opml/Shell script – Wikipedia, the free encyclopediaA shell script is a script written for the shell , or [...]

  35. C Kapadia Says:

    Worked perfectly, thanks!

  36. Shortcut Keys for Google Reader | Gtricks.com Says:

    [...] http://dcostanet.net/wordpress/2005/06/13/export-safari-rss-feeds-via-opml/ [...]

  37. Shane Says:

    After I run the Automater (which seems that it is working) nothing ends up on my Desktop. Is there another location it might be saved?

    Running 10.5.7

  38. Curmudgeon Geographer Says:

    Automator application is broken for me also. I wonder if it is a Safari 4.x issue, which I’m using as well as 10.5.8. Hope this is fixed soon!

  39. Sameer Says:

    Try searching for Safari.opml in Spotlight.

    I’m using 10.5.7 and it works for me. (Safari version 4.0.2). I will update to 10.5.8 and put out a new version if it doesn’t work.

  40. Tobi Says:

    I’m on Snow Leopard + Safari 4.0.3, didn’t worked anymore, but this did:

    http://www.freesmug.org/review/safari2opml/

  41. vincent Says:

    hi,
    I couldn t get the script working on my 10.5.8 . I just wanted to export my 71 rss flow out of mail.app so I change some little thing to make the scritp work ($BASH_ARGV problem).
    I am sharing it with you , if this can help someone.

    cat << HEADER

    Safari OPML Export

    HEADER
    ##sqlite3 ~/Library/Syndication/Database3 ‘select * from Sources;’ | \
    ## sed -e ‘s/&/\&amp\;/g’ -e ‘s//\&gt\;/g’ -e ‘s/”/\&quot\;/g’ -e ‘s/\x2C/\&#39/g’ | \
    ## awk -F”|” ‘{printf “\
    ## “, $4, $2 }’

    IFS=$’\n’;for i in $(find ~/Library/Mail/RSS/ -name “Info.plist”);do TITEL=`echo $i | sed -e “s/\.rssmbox\/Info.plist//” | sed -e “s/.*\/\///” | sed -e “s/[\"&<]//g" ` ;egrep "http[s]*://” $i | sed -e “s/.*\(http[^<]*\).*/\1/" | xargs echo -n "”;done

    cat << FOOTER

    FOOTER

    this pass opml validation on all my flow, support https flow, title with reserved caracters . hope it helps.

    Vincent.

  42. How to make Safari fast again | The choice to be rational is arbitrary Says:

    [...] 1. Moved all my Safari RSS feeds to Google Reader, which has a superior interface anyway, using this tool <http://dcostanet.net/wordpress/2005/06/13/export-safari-rss-feeds-via-opml/>. [...]

  43. Thomas Says:

    Sameer,

    this doesn’t work with 10.6.4 and Safari 5.0.1: The automator deletes the interim file again after completion, and a Safari.opml is nowhere to be found then.

    The updated script by vincent would be nice to have, but it got apparently corrupted here.

    Could you please re-post vincent’s post properly quoted, or update yours with his code, then test on 10.6?

  44. Thomas Says:

    Uh, update:
    vincent’s post mainly need fixing with the “smart quotes”. Turning all “ and ” into ” will get the script to work.
    However, vincent’s script doesn’t read Safari’s bookmarks but those from Mail, so that’s not useful for most of us, probably.

    Also, running your script in Terminal does still work in 10.6.4, only the Automator action appears to be having trouble as described.

  45. Thomas Says:

    Actually,
    the script also is useless with Safari 5, it appears: It produces a list of some older RSS bookmarks, not the current ones Safari 5 uses.

  46. Thomas Says:

    I just wrote an app that makes this all easier:

    http://www.tempel.org/SafariFeedToOPML

    Would appreciate if you’d link to it. Your script was helpful in making mine work, i.e. it showed me the format I needed use put into the opml file. Thanks for that!

  47. NicolaD’Agostino.net » Applicando » Dal Mac a Google Says:

    [...] caso i feed siano in Safari la soluzione migliore si trova all’indirizzo dcostanet.net/wordpress/2005/06/13/export-safari-rss-feeds-via-opml/ sotto due forme: uno script .sh da usare nel Terminale oppure un file per [...]

Leave a Reply