]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Slashdot3.pl
use read to get buffering
[infobot.git] / src / Modules / Slashdot3.pl
index 90fb56e473a3665d4839531845bad6ffc90b54eb..7b94b09c1ae255e89469f111063cf14b7028ad33 100644 (file)
@@ -33,24 +33,24 @@ sub slashdotParse {
 }
 
 sub Slashdot {
-    my @results = &main::getURL("http://www.slashdot.org/slashdot.xml");
+    my @results = &::getURL("http://slashdot.org/slashdot.xml");
     my $retval  = "i could not get the headlines.";
 
     if (scalar @results) {
        my $prefix      = "Slashdot Headlines ";
        my @list        = &slashdotParse(@results);
-       $retval         = &main::formListReply(0, $prefix, @list);
+       $retval         = &::formListReply(0, $prefix, @list);
     }
 
-    &main::performStrictReply($retval);
+    &::performStrictReply($retval);
 }
 
 sub slashdotAnnounce {
-    my $file = "$main::param{tempDir}/slashdot.xml";
+    my $file = "$::param{tempDir}/slashdot.xml";
 
-    my @Cxml = &main::getURL("http://www.slashdot.org/slashdot.xml");
+    my @Cxml = &::getURL("http://slashdot.org/slashdot.xml");
     if (!scalar @Cxml) {
-       &main::DEBUG("sdA: failure (Cxml == NULL).");
+       &::DEBUG("sdA: failure (Cxml == NULL).");
        return;
     }
 
@@ -82,12 +82,12 @@ sub slashdotAnnounce {
     }
 
     if (scalar @new == 0) {
-       &main::status("Slashdot: no new headlines.");
+       &::status("Slashdot: no new headlines.");
        return;
     }
 
     if (scalar @new == scalar @Chl) {
-       &main::DEBUG("sdA: scalar(new) == scalar(Chl). bad?");
+       &::DEBUG("sdA: scalar(new) == scalar(Chl). bad?");
     }
 
     open(OUT,">$file");
@@ -96,18 +96,8 @@ sub slashdotAnnounce {
     }
     close OUT;
 
-    my $line   = "Slashdot: News for nerds, stuff that matters -- ".
+    return "Slashdot: News for nerds, stuff that matters -- ".
                        join(" \002::\002 ", @new);
-
-    my @chans = split(/[\s\t]+/, lc $main::param{'slashdotAnnounce'});
-    @chans    = keys(%main::channels) unless (scalar @chans);
-    foreach (@chans) {
-       next unless (&main::validChan($_));
-
-       &main::status("sending slashdot update to $_.");
-       &main::notice($_, $line);
-    }
-    sleep 1;   # just in case?
 }
 
 1;