http://qs1969.pair.com?node_id=43857

Announcing the first JCWren programming challenge! (an idea shamelessly stolen from amelinda)

Write some code, win a perlmonks.org T-shirt, become famous1.

The idea:

To have a monthly contest for programming projects demonstrating some degree of skill, but within the ability of an average monk. Projects should take at least a few hours to complete, but shouldn't require skipping work for 3 days. Prizes are fiananced out of my pocket, and are (currently) in no way related to EDC, other than using them as a source for merchandise (and they ARE the only ones with PerlMonks T-Shirts).

The challenge:

Implement a Perl program that will read the file http://headlinenews.cnn.com/QUICKNEWS/virtual/swf.headline.txt and generate a web page with a 3 column table, the left column with the state name, the middle column with a date/time stamp, and the right column with the headline. The script should be able to be run from the cron (*nix) or at (Windows) scheduler. As new headlines for each state are encountered, they should be timestamped and added to a database (flat file, using the CPAN module of your choice. Not mySQL, postGRES, or any other potentially non-portable database). The webpage should be generated when the script is run, and as such is considered static. The page should contain a META tag to attempt an auto-refresh. Above the table should be a list of all states that headlines have been encountered for, and a HREF tag to that table entry (states with no headlines should not have an active link). Required command line options are:
  1. A parameter specifies the refresh interval for the META tag (default is 10 minutes).
  2. A parameter to specify the output path and filename (default is index.html in the current directory).
  3. A parameter to specify (in minutes) the time before an entry is aged out of the database (default is 24 hours).
  4. An option to clear any existing database.

Sample output:

Alabama | Alaska | Georgia | Florida | Iowa | Kentucky | Michigan | Remaining States
Georgia 2000/11/28 17:22 Major earthquake occurs on little known fault line between Atlanta and Macon. Trailer parks considered responsible.
Georgia 2000/11/28 19:44 Lake Sidney Lanier, a major recreational lake, is at a record low. Many boats now high and dry.
Michigan 2000/11/28 17:22 Tim Vroom, local hero and humanitarian, takes www.perlmonks.org commercial, makes millions.

Note that some state names contain spaces, and should not break. The date/time stamp should also not break on a space. Extra points2 for a command line switch that allows font name specification for the text, and uses them correctly for all text on the page.



The rules:

  1. Contest starts 2000/12/01 00:00 EST, and ends 2000/12/08 23:59 EST (unless #2).
  2. Contest ends on first entry that passes contest criteria rules.
  3. By submitting an entry, you agree the criteria has been adequately defined, and is non-contestable.
  4. Entries must be submitted to jcwren@jcwren.com (tar or zip, please)
  5. Winning entry will be notified by /msg.
  6. Entries must run on both Windows and Unix.
  7. Entries must run under Perl 5.005_05 and below.
  8. All platform indepedant CPAN modules are fair game.
  9. Code must contain functioning 'use strict' and -w.
  10. Output HTML must be legal HTML, and pass common HTML checkers.
  11. Winning code will be posted to the Code Catacombs (by the author).
  12. Saint level monks (as of 2000/12/01) are not eligible for contest prizes.
  13. Multiple people may work on a submitted entry, but only one prize will be awarded.
  14. In the event that PerlMonks T-Shirts are unavailable, other EDC products may be substituted.
  15. jcwren will be the judge. In the event of uncertainty, a saint level monk will be consulted.

I have done my best to create what I think are a fair set of rules, and within the capabilities of the average monk. If you have a point that needs clarifying, it needs to be before Friday morning (2000/12/01).

A copy of this page is available at www.tinymicros.com/contest

1 jcwren cannot be held responsible if fame fails to occur. Void where prohibited by law, offers may not be combined, cash value 1/10 cent.
2 Extra points are not redeemable for anything useful. But it does add coolness.
--Chris

e-mail jcwren