After browsing through a couple of other people's CUFP
i've found that this LWP::Simple type thing isn't
actually to original but at the same time, i'm pretty
proud of it
both because it's short and reasonably elegant (but TSE
specific, i don't know how easy it is to generalize)

I wrote it for my dad cause i think it will save hime
HOURS of time looking up stuff on the internet and give
hime the extra time he needs to do the analysis

he didn't want to use an online profile system because
he dosen't want other people to know what his stock
picks look like :)

one thing i would like help with is compiling the code
into an EXE for windows. I've looked at the thread
Compiling Code? and others but cannot make perl2exe OR
perlcc work properly (problems with either the use
LWP::Simple, or perlCC working at ALL)

i'm at the point where i'd just about rather be 'given
the fish' (if you get the reference)

here's the code for those who're interesed . . . note
the REGEX instead of HTML::Parser (yes Dave i knew
you'd be upset with that but ends and means
donchaknow ;)
the regex is actually code re-use i think it was the
strip html tags thread

#!f:\perl\bin\perl #note that strict is commented out, [jjhorner] i'm sure #you'll love that ;) #use strict; use LWP::Simple; my ($webpage,$TickerSymbol,$value,$junk,@wpArray,$counter,$results,%re +sults); my @fields = ("TickerSymbol","LastTraded","NetChange","Open","Low","Hi +gh","Volume","LastBidSize","LastBidPrice","LastAskSize","LastAskPrice +","#ofSharesOutstanding","Rolling52WeekHigh","Rolling52WeekLow","Quot +edMarketValue","DividendTimingIndicator","Earnings/Share(trailing12mo +nths)","DividendYield"); # ts file is a one-per line list of the TSE ticker symbols # that the user wants in their output # the file is terminated on each line with a comma # to keep the ticker symbol clean open tsFILE, "<ts.txt" or die "Couldn't open: $!"; foreach $value (@fields) { print "$value\t" } print "\n"; while (<tsFILE>) { ($TickerSymbol,$junk) = split/,/; $webpage= get "http://www.tse.com/cgi-bin/clan_quote?securityType= +TSE-EQUITY&qoteQuery=" . $TickerSymbol; $webpage =~ s/&nbsp;//g; $webpage =~ s/<[^>]*?>//g; $webpage =~ s/ //g; @wpArray = split (/\n/,$webpage); $counter = 0; foreach $value (@wpArray) { $results{$value} = $wpArray[++$counter]; } $results{"TickerSymbol"} = $TickerSymbol; foreach my $key (@fields) { print "$results{$key}\t"; } print "\n"; }

anyways, i'm very happy with it as i started writing it
last night and it was a lot easier than i though it
would be.

If anyone can turn it into a windows98 EXE for me i
would be eternally in your debt . . . as i said, it's
intended as a gift for my father and has to be
standalone
it could bloat from 30K to 1.5 Megs and i wouldn't mind
so long as it worked as an EXE


In reply to Stock Market Tracker (TSE) by Buckaroo Buddha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.