X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FModules%2FQuote.pl;h=33354cd6ab8e244cf2b68dbeef0ec429b047bfaf;hb=8addf484a5b78fe043ac663129be6c05e075f260;hp=0fafefcafd192b37e15756cb15291713f5f9100a;hpb=ccc02c22796957aa2f2951c1146d58645261ad0f;p=infobot.git diff --git a/src/Modules/Quote.pl b/src/Modules/Quote.pl index 0fafefc..33354cd 100644 --- a/src/Modules/Quote.pl +++ b/src/Modules/Quote.pl @@ -20,33 +20,37 @@ sub commify { sub Quote { my $stock = shift; - my @results = &::getURL('http://quote.yahoo.com/d/quotes.csv' . - "?s=$stock&f=sl1d1t1c1ohgv&e=.csv"); + my @results = + &::getURL( 'http://quote.yahoo.com/d/quotes.csv' + . "?s=$stock&f=sl1d1t1c1ohgv&e=.csv" ); - - if (!scalar @results) { - &::msg($::who, "i could not get a stock quote :("); + if ( !scalar @results ) { + &::msg( $::who, "i could not get a stock quote :(" ); } my ($reply); foreach my $result (@results) { - # get rid of the quotes - $result =~ s/\"//g; - my ($ticker, $recent, $date, $time, $change, $open, - $high, $low, $volume) = split(',',$result); + # get rid of the quotes + $result =~ s/\"//g; + + my ( + $ticker, $recent, $date, $time, $change, + $open, $high, $low, $volume + ) = split( ',', $result ); - # add some commas - # "+ 0" removes trailing cr/lf/etc. - my $newvol = commify($volume + 0); + # 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"; + $reply .= ' ;; ' if $reply; + $reply .= + "$ticker: $recent ($high/$low), $date $time, " + . "Opened $open, Volume $newvol, Change $change"; } - if ($reply eq '') { - $reply = "i couldn't get the quote for $stock. sorry. :("; + if ( $reply eq '' ) { + $reply = "i couldn't get the quote for $stock. sorry. :("; } &::performStrictReply($reply);