Write a CGI script that interfaces to a Web-accessible networked resource mapped to the URL of http://gdansk.bradley.edu/olekmali/cgi/p_cgi_hw04.pl that extracts certain data from the plain text file transmitted over the HTTP protocol and displays on a Web page.
The CGI script should be triggered by a button in an HTML form. In addition to that button the form should have two mutually exclusive choices of English (F miles, mph, in Hg) and Metric (C, km, kmph, hPa) units. Depending on that setting the CGI script should generate a narrative report using appropirate data.
When a Web accessible data resource foresaid above is contacted using HTTP
protocol it would respond in one of two possible ways:
Content-Type: text/plain; charset=ISO-8859-1 Pragma: no-cache N/A - Not Ready, try again |
Content-Type: text/plain; charset=ISO-8859-1 Pragma: no-cache Peoria, Illinois 10 9 93 29.77 in 1008 hPa (Falling) 22 East 12.9 93 29.77 in 1008 hPa (Falling) 14 East 8.0 Overcast |
place temperature_celsius dewpoint_celsius humidity pressure wind_kilometersperhour wind_direction visibility_kilometers temperature_fahrenheit dewpoint_fahrenheit humidity pressure wind_milesperhour wind_direction visibility_miles conditions |
In case you cannot connect to the Web accessible resource, or if ten or more connections return data not available response display a nice descriptive error message to a user.
Attach all source code in files with proper names and extensions (*.html, *.java, *.pl, *.php, .htaccess e.t.c.). Do not ZIP files together or include compiled files (e.g. *.class). In case of dynamic Web pages (JavaScript or CGI) or Java applets also send the complete URL (including http://) that points to a page on your Web site that demonstrates your homework. Send your homework via e- mail to the instructor at olekmali at bradley dot edu. Please set the message subject to: web-hwC.
Thank you.