Archive for May 2008

Perl HTML::TableExtract Table Finder Loop

This script parses a web page and prints out all of the coordinates for tables found. This should make your life easier as far as determining the location of the table you are looking to parse.
#!c:\perl\bin\perl.exe
use LWP::Simple;
use LWP::UserAgent;
use HTML::TableExtract;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI;
my $url = “http://www.drudgereport.com/”;
my $capture = get($url);
$depth = 0;
$count = […]

Yahoo Finance Economic Events to XML with Perl

This is a very simple script which gets yahoo economic events from the yahoo finance website and converts it to XML.

#!c:\perl\bin\perl.exe
use LWP::Simple;
use LWP::UserAgent;
use HTML::TableExtract;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI;
my $url = “http://biz.yahoo.com/c/e.html”;
my $capture = get($url);
#http://www.treasurydirect.gov/xml/PendingAuctions.xml
print $cgi->header(-type => ‘application/xml’); # make browser expect xml
$te = HTML::TableExtract->new( depth => 0, count => 5 );
print […]

Yahoo Finance Get Industry and Sector using Perl

This script parses yahoo finance an pulls the Industry and sector for any ticker symbol you pass it. I used it to create a stock screener I am working on. Hope it becomes useful for you.

#!c:\perl\bin\perl.exe
use LWP::Simple;
use LWP::UserAgent;
use HTML::TableExtract;
if ($#ARGV != 0) {
print “$#ARGV usage: need to pass in a symbol\n”;
exit;
}
$sym = $ARGV[0];
my $url = […]

Dividend Reinvestment Calculator

I have been a moderate investor in Dividend Reinvestment Plans. aka (DRIPS) If you are not sure what that is, check out http://www.fool.com/school/drips.htm as they do a pretty good job explaining it.
But basically it allows investors to buy shares of a particular equity on a periodic basis (bi-weekly, monthly,quarterly etc). Dividends on that […]

How to Create a Stored Proc in MySQL

I haven’t seen this very well and clearly documented, as far as passing parameters go. Here is a simple create user proc.

DELIMITER $$
DROP PROCEDURE IF EXISTS `portfoliomanager`.`createNewUser` $$
CREATE PROCEDURE `portfoliomanager`.`createNewUser` (IN username varchar(45),IN pass varchar(45))
BEGIN
INSERT INTO portfoliomanager.users (email,password) VALUES(username,pass);
END $$
DELIMITER ;

FLEX and Perl Export to Excel

Need to export a Flex Datagrid to Excel CSV?
Here is a link to the Flex code
The flex code will convert the DataGrid to a CSV string. Which you will then post to a cgi….code below.
You can see it in action on my Dividend Reinvestment Tool 
#!/usr/bin/perl
use CGI qw(:standard);
my $cgi = new CGI;
my $count = 0;
use […]


Warning: stristr() [function.stristr]: Empty delimiter in /home/thegard5/public_html/gregjessup/wp-content/plugins/wassup/wassup.php on line 2093