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


Click here to return to the '10.5: Export Mail.app's RSS feed URLs in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Export Mail.app's RSS feed URLs in Terminal
Authored by: chleuasme on Mar 26, '08 10:49:48PM
You can simply use defaults ;-)
for i in ~/Library/Mail/RSS/*/Info.plist
do
    defaults read "${i%.plist}" RSSFeedURLString
done

And xargs too

for i in ~/Library/Mail/RSS/*/Info.plist
do
    defaults read "${i%.plist}" RSSFeedURLString
done | xargs -n 1 open


[ Reply to This | # ]
10.5: Export Mail.app's RSS feed URLs in Terminal
Authored by: chill_apple on Apr 09, '08 11:07:28AM
I was trying to get to work so that i can port it to NewsFire. I am not very good at BASH and here is what I came up with (Well I borrowed the script that someone did for Safari). NOTE: I left the code that pulls it out of Safari. Any help would be appreciated.

#!/bin/sh
# version 1.2
# 	* added the htmlURL field for Wordpress
#	* escaped XML special strings from the title field
# Written by Sameer D'Costa and released into the public domain
# http://dcostanet.net/wordpress/2005/06/13/export-safari-rss-feeds-via-opml/


cat << HEADER
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
	<head>
		<title>Safari OPML Export</title>
	</head>
	<body>
		<outline text="Mail Feeds">
HEADER
sqlite3 ~/Library/Syndication/Database3 'select *  from Sources;' | \
	sed -e 's/&/\&amp\;/g'  -e 's/</\&lt\;/g' -e 's/>/\&gt\;/g' -e 's/"/\&quot\;/g' -e 's/\x2C/\&#39/g' | \
	awk -F"|" '{printf "<outline type=\"rss\" text=\"\" title=\"%s\" xmlUrl=\"%s\"\ />\
		", $4, $2   }'

IFS=$'\n';for i in $(find ~/Library/Mail/RSS/ -name "Info.plist");do grep "<string>http://" $i | sed -e "s/.*\(http[^<]*\).*/\1/" | xargs echo "<outline type=\"rss\" text=\"\" title=\"$BASH_ARGV\" xmlUrl=\"$BASH_ARGV\" \/>";done


cat << FOOTER
                </outline>
        </body>
</opml>
FOOTER


Thanks,
Calvin


[ Reply to This | # ]
10.5: Export Mail.app's RSS feed URLs in Terminal
Authored by: chleuasme on Apr 13, '08 06:33:33AM
I just read your post. Here is a bash script which should allow you to import the Mail RSS feeds in NewsFire :
#!/bin/bash

of=/dev/stdout
[ $# -gt 0 ] && of=$1

cat > "$of" << HEADER
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
	<head>
		<title>Mail RSS OPML Export</title>
	</head>
	<body>
		<outline text="Mail Feeds">
HEADER

for mbox in ~/Library/Mail/RSS/*.rssmbox
do
    title=$(echo ${mbox##*/} | sed 's:.rssmbox::')
    url=$(defaults read "${mbox}/Info" RSSFeedURLString)
    echo "<outline type=\"rss\" text=\"\" title=\"$title\" xmlUrl=\"$url\" />"
done >> "$of"

cat >> "$of" << FOOTER
                </outline>
        </body>
</opml>
FOOTER
With no option, it should work the same ways the one you gave code, or you can give an output file name as argument.

[ Reply to This | # ]
10.5: Export Mail.app's RSS feed URLs in Terminal
Authored by: tiktuk on May 14, '10 03:06:33PM
This worked well after I had added (as I also noted in the comment above) another /* because I keep my feeds in folders. And afterwards I had to replace all & characters in urls with & a m p ; (without the spaces..) to make it valid xml.

[ Reply to This | # ]
10.5: Export Mail.app's RSS feed URLs in Terminal
Authored by: tiktuk on May 14, '10 02:57:02PM
As I keep my feeds organized in folders I had to change the above path to ~/Library/Mail/RSS/*/*/Info.plist (note the extra */). Works very well, thank you.

[ Reply to This | # ]