summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2012-12-23 05:01:26 +0000
committerRuss Allbery <eagle@eyrie.org>2012-12-23 05:01:26 +0000
commit34e100b65d64e64a572ffec1c808fe0868f96de3 (patch)
treedb8e5ea4616caf6b14cf7765e26d1f4d6a89d37c /bin
parenta0604611396dc37112045a6aed79865303735eed (diff)
When generating the RSS feed for book reviews, strip out the ebook
disclaimer paragraph the same as is done for the HTML version.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/spin-rss6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/spin-rss b/bin/spin-rss
index 94a4ddc..ad3c2e6 100755
--- a/bin/spin-rss
+++ b/bin/spin-rss
@@ -195,14 +195,18 @@ sub rss_review {
die "$0: cannot find title and author in $file"
unless ($title && $author);
pop @page while (@page and $page[$#page] !~ /<p class=\"rating\">/);
- my $buy;
+ my ($buy, $ebook);
for my $i (0 .. $#page) {
+ if ($page[$i] =~ /<p class=\"ebook\">/) {
+ $ebook = $i;
+ }
if ($page[$i] =~ /<p class=\"buy\">/) {
$buy = $i;
last;
}
}
splice (@page, $buy, 2) if $buy;
+ splice (@page, $ebook, 4) if $ebook;
my $page = join ('', @page);
$page =~ s/^\s*<table[^>]+>/<table>/mg;
$page =~ s/^\s*<tr/ <tr/mg;