Skip to content

mgrossu/ClientforOpenWeatherMapAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Client for OpenWeatherMap API

Project 1 for IPK course at Faculty of Information Technology, Brno University of Technology

Name and surname: Marius Iustin Grossu

Login: xgross10

Implementation

Due to the assignment where we had to choose a programming language in which we can write a client for OpenWeatherMap, I choosed Python. From the beginning, I created a network socket and checked whether it is possible to communicate with the server via HTTP port (80) using the socket library in Python. If the connection is successful, a GET request is created and sent to the servers. Upon receipt of the response, it processes the message so that it receives a status code from the header, which shows us that everything is OK. Unnecessary information is left and transferred to JSON, for better handling using the json library. Subsequently, based on the JSON we obtained, it looks for individual items that need to be displayed as specified. This lightweight client displays city name, temperature, humidity, pressure, wind direction and speed after entering:

$ make run api_key = <API_KEY> city =

Not knowing how to handle this client, I extended the functionality,

$ make help

where it shows how to start this client properly. You must always enter a valid API key, which will be obtained by registering for free with [OpenWeatherMap] (https://openweathermap.org/). If any information is missing, N / A is displayed.

temp: N / A humidity: N / A pressure: N / A

  • example of missing information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published