diff --git a/README.md b/README.md index 9c24e80..6e9ffc3 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,26 @@ # Weather Icons -This is a small app made to create weather icons in the form of svg files based on input through [ZeroMQ](https://zeromq.org/). +This is a small app made to create weather icons in the form of svg files based on input +through [ZeroMQ](https://zeromq.org/). ## Requesting Data -To request data, setup a [ZeroMQ Request-Reply Pattern](https://zeromq.org/socket-api/#request-reply-pattern), with the port being 5555. -Specific examples for most programming languages can be found [here.](https://zeromq.org/get-started/). +(The exe provided in the [releases](https://github.com/arc25275/weather_icons/releases/) needs to be running when you +want to request data.) + +To request data, setup a [ZeroMQ Request-Reply Pattern](https://zeromq.org/socket-api/#request-reply-pattern), with the +port being 5555. +Specific examples for most programming languages can be found [here.](https://zeromq.org/get-started/). Data needs to be requested with a **_stringified_** json object in the following format: ```json5 - - { - "sun": Bool, //True is Day, False is Night + "sun": Bool, + //True is Day, False is Night // For rain, snow, clouds, and wind, 0 means there is none, and 1,2, and 3 are varying levels of intensity. - "rain": 0-4, // If rain is 4, it means there is lightning. + "rain": 0-4, + // If rain is 4, it means there is lightning. "snow": 0-3, "clouds": 0-3, "wind": 0-3, @@ -42,9 +47,10 @@ data = { socket.send_string(json.dumps(data)) ``` - ## Recieving Data -Data is recieved with the same socket, but it will not be a string this time, but instead be a normal message, in the form of a binary encoded string. + +Data is recieved with the same socket, but it will not be a string this time, but instead be a normal message, in the +form of a binary encoded string. For example in python, it will come in the format `b"..."`. To recieve this data, all you need to do is call the function to recieve though the socket, like so in python: @@ -53,48 +59,63 @@ To recieve this data, all you need to do is call the function to recieve though data = socket.recv() ``` -The data itself will be svg code that you can then use for whatever purposes that you require. You could save it in a file to use for later, or dynamically load the svg depending on what inputs you have. +The data itself will be svg code that you can then use for whatever purposes that you require. You could save it in a +file to use for later, or dynamically load the svg depending on what inputs you have. For the example data above, the output svg will be ```xml - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + - ``` @@ -103,3 +124,4 @@ And when rendered, it will look like this: ![example_weather](https://github.com/arc25275/weather_icons/assets/55003876/05287047-6407-4cd8-9ed9-a5a72d0a8db3) ## UML +