Weather Data Retrieval

Difficulty: Medium

178

ABOUT

For a final project in my Systems Programming class, we had to create a TCP connection and use a GET request to the national weather station to get the most recent weather data and display it to the user in the console. This was a group project I worked on with my classmates Nick and Alan. We had trouble establishing a secure connection to the host, so our instructor extracted the files and put it on his personal website. However, the code will be written in the way it should be connecting correctly to the host of the national weather service.

Diagram

This is a state machine about how this project works. We first display the nearby locations for the user. Currently, the locations are hardcoded into the system so it will show 12 cities in Iowa. The 60 second inactive timer will start and after 60 seconds without activity, the application will terminate. Otherwise, when the user picks a weather station to connect to, it will establish a TCP connection. The XML content will be received and stored in a file on the host computer. The buffer of received XML will be parsed through from the tags and the values between the tags will be stored in local variables and displayed to the user.

More Projects You May Like