OPML Export Feeds


OPML Export Feeds

Opml-export-feeds exports RSS/Atom feed urls from OPML.

OPML is a popular format for copying list of feeds from one feed aggregator to another. For example, one might copy feeds from Google Reader to Akregator. However, some aggregators, such as rawdog, lack the support for OPML.

Opml-export-feeds can simply export urls or output them in a format suitable for rawdog config file.

#!/usr/bin/perl
# opml-export-feeds 0.5 - export feed urls from OPML file, optionally in rawdog config format
# (c) 2007-09-07 Tero Karvinen www.iki.fi/karvinen
# GNU General Public License, version 2 or later
# usage:
# opml-export-feeds --rawdog-config foo-opml.xml > foo.txt
# cat foo.txt >> ~/.rawdog/config
 
use strict;
 
my $rawdog_config=0; # false
if ($ARGV[0] =~ "--rawdog-config") {
	$rawdog_config=1;
	shift;
};
 
my $filename=$ARGV[0];
open(FILE, "$filename") or die "Can't open "$filename": $!";
 
my $xmlUrl="";
 
while (<FILE>) {
	$_ =~ /xmlUrl="([^"]+)"/;
	$xmlUrl="";
	if (! "$xmlUrl" =~ /^$/) {
		if ($rawdog_config) { print "feed 3h " }
		print "$xmlUrln"
	}
}
 
close FILE;
 



Links

Langridge, Stuart: Looking at rawdog “If you’ve got an OPML file, you can import it into rawdog with a (fairly complex) Python and bash one-liner” http://www.kryogenix.org/days/category/software/python/rawdog/ This was the first OPML to rawdog converter I have seen. My solution on this page, opml-export-feeds, performed 10-100 times faster than that one-liner in my non-scientific test.

Sampson, Adam: rawdog. Official program homepage. http://offog.org/code/rawdog.html


Posted in Old Site | Tagged , , , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Recent Posts

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects