From infobot-dev@metronomicon.com  Tue Jan  4 17:52:16 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id RAA06066
	for infobot-dev-list; Tue, 4 Jan 2000 17:52:07 -0500
Received: from ux1.sp.cs.cmu.edu (UX1.SP.CS.CMU.EDU [128.2.198.101])
	by token.metronomicon.com (8.9.3/8.8.7) with SMTP id RAA06063
	for <infobot-dev@infobot.org>; Tue, 4 Jan 2000 17:52:06 -0500
Received: from ip251.pittsburgh5.pa.pub-ip.psi.net by ux1.sp.cs.cmu.edu
          id aa09776; 4 Jan 2000 17:52 EST
Message-ID: <38728710.E2069A9E@cs.cmu.edu>
Date: Tue, 04 Jan 2000 18:49:36 -0500
From: Kevin Lenzo <lenzo@cs.cmu.edu>
Organization: School of Computer Science, Carnegie Mellon University
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.12 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: infobot-dev@infobot.org
Subject: Private CPAN Bundle for Module Modules
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

Hi folks,

I've just made up a private CPAN bundle that
should make getting all the Infobot::Module
dependencies for you.

http://www.infobot.org/dev/i-bundle.tgz

get it, unpack it, then enter the directory
  infobot-private-bundle

and do  

 perl -MCPAN -e 'install Bundle::infobot_modules'

or 

 perl -MCPAN -e shell
 install Bundle::infobot_modules

this should get you everything like Geo::METAR,
Term::ANSIColor, Term::ReadLine, WWW::Search,
LWP, Net::Telnet, Math::Trig, Math::Units, etc
etc etc.

POE is NOT in there, because we require 
POE 0.0804 or better (in the 0.08 clan).  When
the next version of POE gets on CPAN, it will also
be in the Bundle.

Let me know how it goes,

kevin
lenzo@cs.cmu.edu

From infobot-dev@metronomicon.com  Tue Jan  4 21:05:09 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id VAA06731
	for infobot-dev-list; Tue, 4 Jan 2000 21:05:05 -0500
Received: from verdi.siteprotect.com (verdi.siteprotect.com [209.100.98.18])
	by token.metronomicon.com (8.9.3/8.8.7) with ESMTP id VAA06728
	for <infobot-dev@infobot.org>; Tue, 4 Jan 2000 21:05:05 -0500
Received: from LucidX.com (ppp-207-214-184-171.psdn11.pacbell.net [207.214.184.171])
	by verdi.siteprotect.com (8.8.5/8.8.5) with ESMTP id UAA12714
	for <infobot-dev@infobot.org>; Tue, 4 Jan 2000 20:05:24 -0600
Message-ID: <3872A6F6.A876C906@LucidX.com>
Date: Tue, 04 Jan 2000 18:05:42 -0800
From: Samy Kamkar <CommPort5@lucidx.com>
Organization: LucidX
X-Mailer: Mozilla 4.08 [en] (X11; I; FreeBSD 3.1-RELEASE i386)
MIME-Version: 1.0
To: infobot-dev@infobot.org
Subject: Re: Private CPAN Bundle for Module Modules
References: <38728710.E2069A9E@cs.cmu.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

As I've just experienced Math::Units has some problems, even with the
latest version of CPAN.  Couldn't get it from CPAN directly either, take
a look at this:
--------------------------------
Running make test
<some fun stuff here>
t/*.................can't open t/*.t. No such file or directory
can't close t/*.t. Bad file descriptor
Can't open perl script "t/*.t": No such file or directory
dubious
       Test returned status 2 (wstat 512, 0x200)
FAILED--1 test script could be run, alas--no output ever seen
*** Error code 2
--------------------
Check out the first line...'Running make test'...even though it was a
force install!
I believe Kevin will be updating it by taking the module out unless it
gets fixed.  Also I get some strange stuff when install'ing it after
cleaning it, just Math::Units that is.
Any of you _not_ get this error?

-Samy Kamkar (CommPort5)

From infobot-dev@metronomicon.com  Wed Jan  5 07:51:00 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id HAA09200
	for infobot-dev-list; Wed, 5 Jan 2000 07:50:49 -0500
Received: from ux1.sp.cs.cmu.edu (UX1.SP.CS.CMU.EDU [128.2.198.101])
	by token.metronomicon.com (8.9.3/8.8.7) with SMTP id HAA09197
	for <infobot-dev@infobot.org>; Wed, 5 Jan 2000 07:50:48 -0500
Received: from ip251.pittsburgh5.pa.pub-ip.psi.net by ux1.sp.cs.cmu.edu
          id aa16014; 5 Jan 2000 7:50 EST
Message-ID: <38733D7E.E5F553D0@cs.cmu.edu>
Date: Wed, 05 Jan 2000 07:47:58 -0500
From: Kevin Lenzo <lenzo@cs.cmu.edu>
Organization: School of Computer Science, Carnegie Mellon University
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.12 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Samy Kamkar <CommPort5@lucidx.com>
CC: infobot-dev@infobot.org
Subject: Re: Private CPAN Bundle for Module Modules
References: <38728710.E2069A9E@cs.cmu.edu> <3872A6F6.A876C906@LucidX.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

Yes I got this behaviour also.  Math::Units
requires a 

  force install Math::Units

because the test suite fails.  After you do the force
install, it works in Infobot::Module::Conver -- at least
for me.

I'm going to leave the bundle as it is for a bit, though,
in case this behaviour _doesn't_ show up on some platform.

It shows up for me on RH linux 6.0 and Perl 5.005_3;
Samy was using FreeBSD.

Now to get that IRC interface working with the
new architecture...

kevin


Samy Kamkar wrote:
> 
> As I've just experienced Math::Units has some problems, even with the
> latest version of CPAN.  Couldn't get it from CPAN directly either, take
> a look at this:
> --------------------------------
> Running make test
> <some fun stuff here>
> t/*.................can't open t/*.t. No such file or directory
> can't close t/*.t. Bad file descriptor
> Can't open perl script "t/*.t": No such file or directory
> dubious
>        Test returned status 2 (wstat 512, 0x200)
> FAILED--1 test script could be run, alas--no output ever seen
> *** Error code 2
> --------------------
> Check out the first line...'Running make test'...even though it was a
> force install!
> I believe Kevin will be updating it by taking the module out unless it
> gets fixed.  Also I get some strange stuff when install'ing it after
> cleaning it, just Math::Units that is.
> Any of you _not_ get this error?
> 
> -Samy Kamkar (CommPort5)

From infobot-dev@metronomicon.com  Fri Jan  7 04:17:22 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id EAA18168
	for infobot-dev-list; Fri, 7 Jan 2000 04:16:46 -0500
Received: from swami.pcguru.com.au (swami.pcguru.com.au [203.8.109.69])
	by token.metronomicon.com (8.9.3/8.8.7) with ESMTP id EAA18165
	for <infobot-dev@metronomicon.com>; Fri, 7 Jan 2000 04:16:42 -0500
Received: from swami.pcguru.com.au (swami.pcguru.com.au [203.8.109.69])
	by swami.pcguru.com.au (8.9.3/8.8.7) with ESMTP id RAA07809
	for <infobot-dev@metronomicon.com>; Fri, 7 Jan 2000 17:16:43 +0800
Message-ID: <3875AEDD.A96CF4B5@swami.pcguru.com.au>
Date: Fri, 07 Jan 2000 17:16:13 +0800
From: Jason Jordan <guru@swami.pcguru.com.au>
Reply-To: guru@swami.pcguru.com.au
X-No-Archive: Yes
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.3.34 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: infobot-dev@metronomicon.com
Subject: Infobot Modules
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

Howdy,

Has anyone written a module for Infobot that will grab stock quotes, the
Dow and NASDAQ?

I use a channel called #daytraders and this would be very useful.. 8-)

Cheers, Jas

-- 
Jason D. Jordan                            Perth, Western Australia
  ... less than 12 months til the start of the 3rd Millennium and
             the beginning of the 21st Century!
-------------------------------------------------------------------
"The threat to our liberty lies not with the evil-minded ruler, for 
  men born to freedom are quick to resist tyranny, rather it lies 
  with men of zeal - well meaning, but lacking in understanding." 
         Justice Louis Brandeis - USA Supreme Court

From infobot-dev@metronomicon.com  Fri Jan  7 04:51:57 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id EAA18305
	for infobot-dev-list; Fri, 7 Jan 2000 04:51:56 -0500
Received: from othersideofthe.earth.li (IDENT:qmailr@othersideofthe.earth.li [210.145.136.209])
	by token.metronomicon.com (8.9.3/8.8.7) with SMTP id EAA18302
	for <infobot-dev@metronomicon.com>; Fri, 7 Jan 2000 04:51:54 -0500
Received: (qmail 11260 invoked by uid 500); 7 Jan 2000 09:52:28 -0000
Date: Fri, 7 Jan 2000 18:52:28 +0900
From: Simon Cozens <simon@brecon.co.uk>
To: infobot-dev@metronomicon.com
Subject: Re: Infobot Modules
Message-ID: <20000107185228.A11250@othersideofthe.earth.li>
Reply-To: Simon Cozens <simon@brecon.co.uk>
References: <3875AEDD.A96CF4B5@swami.pcguru.com.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.6i
In-Reply-To: <3875AEDD.A96CF4B5@swami.pcguru.com.au>; from Jason Jordan on Fri, Jan 07, 2000 at 05:16:13PM +0800
X-Operating-System: Linux othersideofthe.earth.li 2.2.13
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

On Fri, Jan 07, 2000 at 05:16:13PM +0800, Jason Jordan wrote:
> Has anyone written a module for Infobot that will grab stock quotes, the
> Dow and NASDAQ?

I've sent the quote.pl thingy separately. I've not be following the current
thread very well - do we have a central repository for these extensions now?

Simon
-- 
As in certain cults it is possible to kill a process if you know its true name.
		-- Ken Thompson and Dennis M. Ritchie

From infobot-dev@metronomicon.com  Fri Jan  7 07:57:14 2000
Return-Path: <infobot-dev@metronomicon.com>
Received: (from majordomo@localhost)
	by token.metronomicon.com (8.9.3/8.8.7) id HAA18924
	for infobot-dev-list; Fri, 7 Jan 2000 07:57:04 -0500
Received: from ux1.sp.cs.cmu.edu (UX1.SP.CS.CMU.EDU [128.2.198.101])
	by token.metronomicon.com (8.9.3/8.8.7) with SMTP id HAA18921
	for <infobot-dev@metronomicon.com>; Fri, 7 Jan 2000 07:57:04 -0500
Received: from ip251.pittsburgh5.pa.pub-ip.psi.net by ux1.sp.cs.cmu.edu
          id aa15653; 7 Jan 2000 7:57 EST
Message-ID: <3875E1F8.B7A9D9FC@cs.cmu.edu>
Date: Fri, 07 Jan 2000 07:54:16 -0500
From: Kevin Lenzo <lenzo@cs.cmu.edu>
Organization: School of Computer Science, Carnegie Mellon University
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.12 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Simon Cozens <simon@brecon.co.uk>
CC: infobot-dev@metronomicon.com
Subject: Re: Infobot Modules
References: <3875AEDD.A96CF4B5@swami.pcguru.com.au> <20000107185228.A11250@othersideofthe.earth.li>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: infobot-dev@metronomicon.com
Precedence: bulk
Status: O

hi folks,

Teckle did Infobot::Module::Stock.pm as a module, to answer
the immediate question (simon i was to slow in converting
stock.pl to a module, and the new one is quite compact), but
that raises the issue of who does what to which modules.

the Infobot will be on CPAN, and I'm sure that I would be 
overwhelmed and slow if I independently made every change to
the Infobot::Modules that other people develop; furthermore,
I hope people will put things under the Infobot::Module
directory on CPAN using PAUSE without me being involved. 

I think I'll try to keep the Infobot core with a few modules,
and then have a Bundle on CPAN for pulling in all the
modules there.  That means that module authors should probably
all get PAUSE ids, though it's not required, of course.

So far, the contributed Modules have been in the .tar.gz
files on 
   http://www.infobot.org/dev/ 
and the discussion is archived on
   http://www.infobot.org/list/
which has most of the submissions, it it's awkward to get
to because the modules aren't individually available yet.

I'll make a burst directory that has the whole source
open, but this will just be a short-term solution for
having the whole tree under CVS.


Simon Cozens wrote:
> 
> On Fri, Jan 07, 2000 at 05:16:13PM +0800, Jason Jordan wrote:
> > Has anyone written a module for Infobot that will grab stock quotes, the
> > Dow and NASDAQ?
> 
> I've sent the quote.pl thingy separately. I've not be following the current
> thread very well - do we have a central repository for these extensions now?
> 
> Simon
> --
> As in certain cults it is possible to kill a process if you know its true name.
>                 -- Ken Thompson and Dennis M. Ritchie

included below is Infobot::Module::Stock.pm in its current
state.

cheers,

kevin
# 
#  Stock -- infobot module for stock quote lookups.
#           requires the LWP::Simple module.
#  By Jay Jacobs (teckle)
#  CSV pointers from Carl Boernecke (Rizz)
#

package Infobot::Module::Stock;

use strict;
use Infobot::Module;

$Infobot::Module::Stock::VERSION = "0.10_00";
$Infobot::Module{"Stock"} = $Infobot::Module::Stock::VERSION;
@Infobot::Module::Stock::ISA = qw(Infobot::Module);

my $any_bad;

BEGIN {
  eval { require LWP::Simple };
  $@ and $any_bad = "LWP::Simple";
  warn "Infobot::Module::Stock requires $any_bad" if $any_bad;
}

sub Infobot::Module::Stock::new {
  my $class = shift ;
  return undef if $any_bad;

  my $self  = $class->SUPER::new(@_);
  $self->weight(0); 
  
  $self->enabled(1);
  $self->name('Stock');
  $self->regex(qr/stock\s+(?:price |quote |for )?\s*(?:for|at|of)?\s*(\S+)/i);
  $self->usage('stock <SYMBOL>');
  $self->descrip("Tries to lookup stock quote for SYMBOL");

  bless $self, $class;
}

sub Infobot::Module::Stock::action {
  my ($self, $message) = @_;
  return undef unless $self->enabled;

  my $symbol = uc($message->get('args')->[0]);
  $self->status(5,"looking up stock for $symbol");
  my $content = LWP::Simple::get("http://finance.yahoo.com/d/quotes.csv?s=$symbo
l\&f=sl1d1t1c1ohgv\&e=.csv");
  return("$symbol: could not get information") if (! defined $content);
  my ($trade, $change) = (split(/,/, $content))[1,4];
  return("stock symbol '$symbol' doesn't exist") if ($trade eq "0.00");
  return("$symbol last traded at $trade ($change change)");
}

1;

__END__

=head1 NAME

Stock -- looks up the current stock quote of a given stock.

=head1 SYNOPSIS

stock for <SYMBOL>

stock quote for <SYMBOL>

=head1 PREREQUISITES

        LWP::Simple

=head1 DESCRIPTION

        Connects up to yahoo's stock webpage, pulls down
        a CSV file and parses it for the info.

=head1 AUTHORS

Jay Jacobs (teckle) <jjacobs@securetty.org>
Rizz++ for the csv information.


