]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Slashdot3.pl
speeling
[infobot.git] / src / Modules / Slashdot3.pl
index 02d74d6c8519d24b42928d3383c3f84c7864a21e..7b94b09c1ae255e89469f111063cf14b7028ad33 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Slashdot.pl: Slashdot headline retrival
 #      Author: Chris Tessone <tessone@imsa.edu>
-#    Modified: xk <xk@leguin.openprojects.net>
+#    Modified: dms
 #   Licensing: Artistic License (as perl itself)
 #     Version: v0.4 (19991125)
 #
@@ -33,28 +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 = "Temp/slashdot.xml";
-    if (! -d "Temp/") {
-       &main::DEBUG("sdA: mking dir.");
-       mkdir "Temp", 0755;
-    }
+    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;
     }
 
@@ -86,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");
@@ -100,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;