aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Scheibenpflug <zorchenhimer@gmail.com>2015-05-08 05:13:29 (GMT)
committerNick Scheibenpflug <zorchenhimer@gmail.com>2015-05-08 05:13:29 (GMT)
commit3a13ea256cfa9aa091830ceef080301fc7b5ade7 (patch)
tree35c5aeaf0bb0d0fa4a6297d0092cd7a787b6b53a
parent3369aaa9068dd34e1d3bb19a854a1137ce69f812 (diff)
downloadslipshine-rss-3a13ea256cfa9aa091830ceef080301fc7b5ade7.zip
slipshine-rss-3a13ea256cfa9aa091830ceef080301fc7b5ade7.tar.gz
Removed version that used XML::RSS
-rw-r--r--rss-fix.pl34
1 files changed, 0 insertions, 34 deletions
diff --git a/rss-fix.pl b/rss-fix.pl
deleted file mode 100644
index 54ff1f2..0000000
--- a/rss-fix.pl
+++ /dev/null
@@ -1,34 +0,0 @@
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use XML::RSS;
7use LWP::Simple;
8use Digest::MD5 qw(md5_hex);
9
10my $rss = new XML::RSS;
11my $borked_rss = get('http://orgymania.net/updates.xml');
12my $data = $rss->parse($borked_rss);
13
14foreach my $item (@{$data->{'items'}}) {
15 my $orig_title = $item->{'title'};
16 $item->{'description'} =~ /<a href="([^"]+)">([^<]+)<\/a>/;
17 my ($real_link, $real_title) = ($1, $2);
18
19 $item->{'description'} =~ s/<.*?>//g;
20 $item->{'description'} =~ s/\s+/ /sg;
21
22 $item->{'description'} =~ s/^ //g;
23 $item->{'description'} =~ s/ $//g;
24
25 $item->{'link'} = $real_link;
26 $item->{'title'} = $real_title;
27 $item->{'guid'} = md5_hex("$orig_title $real_link");
28}
29
30$data->save('fixed.xml');
31
32print "Content-type: text/xml\n\n";
33print $data->as_string;
34