Browse Source

* case-insensitive match

master
Alex 'AdUser' Z 10 years ago
parent
commit
0d543de660
  1. 4
      twatch-lite

4
twatch-lite

@ -133,10 +133,10 @@ sub process_feed {
foreach my $match (@{ $feedconf->{matches} }) { foreach my $match (@{ $feedconf->{matches} }) {
if ($match =~ m{^/(.*)/$}) { if ($match =~ m{^/(.*)/$}) {
_log(debug => "Trying regex '$1'"); _log(debug => "Trying regex '$1'");
next unless $text =~ qr/$1/; next unless $text =~ qr/$1/i;
} else { } else {
_log(debug => "Trying substr '$match'"); _log(debug => "Trying substr '$match'");
next unless index($text, $match) >= 0; next unless index(lc($text), lc($match)) >= 0;
} }
# gotcha! # gotcha!
my $msg = sprintf "Got it! URL: %s (%s)", $entry->link, $entry->title; my $msg = sprintf "Got it! URL: %s (%s)", $entry->link, $entry->title;

Loading…
Cancel
Save