Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle errors when RIL text API returns empty

  • Loading branch information...
commit 30b77653a6d232c1a994236762b36aecbe88c759 1 parent 0094b99
@miyagawa authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/RILFeed.pm
View
3  lib/RILFeed.pm
@@ -1,5 +1,6 @@
package RILFeed;
use strict;
+use warnings;
use LWP::Simple;
use URI;
use XML::RSS;
@@ -74,6 +75,8 @@ sub serve_rss {
$cache->set($id => $html);
}
+ $html ||= '(Read It Later could not fetch the article)';
+
$html =~ s/&#(\d+);/chr($1)/eg;
$html =~ s!</\w+$!!; # RIL API bug
Please sign in to comment.
Something went wrong with that request. Please try again.