Saturday, March 6, 2010

Data Sources: Web Scraping

Pushed a couple of perl programs to the repository that do a little webscraping to get some data sources. They require the WWW::Mechanize and HTML::TableExtract modules to run. One gets the NY Lotto results(don't need the convoluted command anymore) and the other grabs the U.S. national debt numbers from the treasury department.

Sample output: $ ./grab_lotto_results.pl

Mega Millions: Mar 5:

11, 31, 34, 44, 52
Megaball: 32
Past Year's Numbers
Next Jackpot: Check back later.
Next Drawing: Tues, Mar 9
Mar 3:

LOTTO: Mar 3:

2, 17, 30, 38, 43, 53
Bonus: 27
Extra: 15
Past Year's Numbers
Next Jackpot: $19.5 million
Next Drawing: Sat, Mar 6

$ ./grab_debt.pl
Current: 03/04/2010
Debt Held by the Public: 8,061,072,722,591.94
Intragovernmental Holdings: 4,484,417,290,440.35
Total Public Debt Outstanding: 12,545,490,013,032.29

No comments:

Post a Comment