10.5: Export Mail.app's RSS feed URLs in Terminal

Mar 26, '08 07:30:02AM

Contributed by: Luziferus

As I wanted to pass my newsfeeds from Mail.app to a friend I realized that there is no "Export RSS-feeds to ..." button in Mail.app. So I wrote this little workaround to export them in Terminal (assuming the bash default shell):

IFS=$'\n';for i in $(find ~/Library/Mail/RSS/ -name "Info.plist");do grep "<string>http://" $i | sed "s/.*\(http[^<]*\).*/\1/";done
This exports all URLs from your Mail.app RSS directory directly into the shell. I could then easily pass this list to my friend. As an additional option, here is a little modification to open all feed URLs in the default web browser:
IFS=$'\n';for i in $(find ~/Library/Mail/RSS/ -name "Info.plist");do open $(grep "<string>http://" $i | sed "s/.*\(http[^<]*\).*/\1/;s/http/feed/");done
This opens your feeds in the browser with a feed://... URL. Then you can easily add them to your bookmarks bar, or can do something other with them. Note that you may add && sleep 60 after the last bracket if you have lots of feeds in Mail.app.

Comments (11)


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