]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Quote.pl
take a few more things literally
[infobot.git] / src / Modules / Quote.pl
index de455bd87cd73fd187e3a5e89fb7784f573c573d..14ee9fb3ba4d5df272814e0b9a204675357096bd 100644 (file)
@@ -20,7 +20,7 @@ sub commify {
 
 sub Quote {
     my $stock = shift;
-    my @results = &::getURL("http://quote.yahoo.com/d/quotes.csv" .
+    my @results = &::getURL('http://quote.yahoo.com/d/quotes.csv' .
            "?s=$stock&f=sl1d1t1c1ohgv&e=.csv");
 
 
@@ -36,15 +36,16 @@ sub Quote {
        my ($ticker, $recent, $date, $time, $change, $open,
            $high, $low, $volume) = split(',',$result);
 
-        # add some commas
-       my $newvol = commify($volume);
+       # add some commas
+       # "+ 0" removes trailing cr/lf/etc.
+       my $newvol = commify($volume + 0);
 
        $reply .= ' ;; ' if $reply;
        $reply .= "$ticker: $recent ($high/$low), $date $time, " .
                "Opened $open, Volume $newvol, Change $change";
     }
 
-    if ($reply eq "") {
+    if ($reply eq '') {
        $reply = "i couldn't get the quote for $stock. sorry. :(";
     }