{"id":23269997,"url":"https://github.com/alexlnkp/weatherscript","last_synced_at":"2025-06-13T19:05:05.138Z","repository":{"id":232732803,"uuid":"785049944","full_name":"alexlnkp/weatherscript","owner":"alexlnkp","description":"An easy-to-use-and-customize C++ program for yielding weather report and printing it out","archived":false,"fork":false,"pushed_at":"2024-09-04T09:28:22.000Z","size":178,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-19T18:42:22.137Z","etag":null,"topics":["cpp","weather-forecast","weather-report","wttr","wttrin"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexlnkp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T05:00:08.000Z","updated_at":"2024-09-04T09:28:26.000Z","dependencies_parsed_at":"2024-04-11T06:30:51.387Z","dependency_job_id":"f3774a62-db38-4645-a473-17427cb734ac","html_url":"https://github.com/alexlnkp/weatherscript","commit_stats":null,"previous_names":["alexlnkp/weatherscript"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexlnkp%2Fweatherscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexlnkp%2Fweatherscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexlnkp%2Fweatherscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexlnkp%2Fweatherscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexlnkp","download_url":"https://codeload.github.com/alexlnkp/weatherscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238489810,"owners_count":19481049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","weather-forecast","weather-report","wttr","wttrin"],"created_at":"2024-12-19T18:37:23.632Z","updated_at":"2025-02-12T14:45:17.821Z","avatar_url":"https://github.com/alexlnkp.png","language":"C++","readme":"[![C/C++ CI](https://github.com/alexlnkp/weatherscript/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/alexlnkp/weatherscript/actions/workflows/c-cpp.yml)\n# WeatherScript \nUtility made for easy and fast yield of weather report for the area.\n\nIt uses a fantastic website called [**wttr.in**](https://wttr.in) for the weather report itself\n\nA [**JSON library**](https://github.com/nlohmann/json) is made by [@nlohmann](https://github.com/nlohmann)!\n\nThe program is based off a python script by [@SolDoesTech](https://github.com/SolDoesTech), [SolDoesTech/HyprV/waybar/scripts/waybar-wttr.py](https://github.com/SolDoesTech/HyprV4/blob/c81cf650443d680bf7a589de6128d01020dd1bc6/HyprV/waybar/scripts/waybar-wttr.py)\n\n\n### Why\nThis small program is made for people who want to check the weather, above all things. This might include checking the weather by displaying it in the Waybar or anything like that, too!\n\n\n### Note\nWebsite looks at your IP for the area you're located at. Using proxy or VPN will most likely yield incorrect results unless you specify location as an argument. For instruction look at the [**Usage**](https://github.com/alexlnkp/weatherscript/tree/master#usage) section.\n\n## Dependencies\n- Using your package manager install curl developer package.\n   - Ubuntu: `sudo apt-get install libcurl4-openssl-dev`\n   - Arch: `sudo pacman -S curl`\n\n## Building\n1. Clone the repository using `git clone https://github.com/alexlnkp/weatherscript.git`\n2. `cd` into the cloned repository'\n3. Make\n   - Run `make SYSTEM=imperial` for Imperial system (Fahrenheit)\n     \n     OR\n     \n   - Run `make SYSTEM=metric` or simply `make` for Metric system (Celcius)\n\n## Usage\n- To get a weather forecast for the area determined by your IP - simply run the program.\n- To get a weather forecast for a specific area - run the program with an argument (e.g. `Paris` for weather in Paris)\n\n## Modifying\nThe code relies on simply requesting the webpage's contents directly from https://wttr.in/?format=j1.\nIt yields the JSON table that includes a **TON** of information about the weather, including `FeelsLike[C|F]`, `visibility[Miles]`, `humidity`, and much more!\nTherefore, you can very simply modify the code by adding or removing data you parse from the JSON.\n\nFor instance, here's how you yield the `visibility` in meters:\n\n- `src/main.cpp`**:**\n```cpp\nstd::string visibility = json_res[\"current_condition\"][0][\"visibility\"];\n```\n\nThen, you can easily modify the `std::cout` by adding this information. For example:\n\n- `src/main.cpp`**:**\n```cpp\nstd::cout \u003c\u003c weather_symbol \u003c\u003c ' ' \u003c\u003c temp \u003c\u003c TEMP_SYMBOL \u003c\u003c '(' \u003c\u003c visibility \u003c\u003c ')' \u003c\u003c std::endl;\n```\n\nWill print out additionally the Visibility parameter for the temperature in the parenthesis.\n\nYou could also make code more versatile by looking at the top of the `main.cpp` and changing the fields to yield information from according to the system the app is built for.\n\nSo, you could add a new define at the top, like so:\n\n- `src/main.cpp`**:**\n```cpp\n#ifdef IMPERIAL\n\t#define TEMP_SYMBOL \"°F\"\n\t#define TEMP_TYPE \"temp_F\"\n  #define VISIBILITY \"visibilityMiles\" // Our new data\n#else\n\t#define TEMP_SYMBOL \"°C\"\n\t#define TEMP_TYPE \"temp_C\"\n  #define VISIBILITY \"visibility\" // Our new data\n#endif\n```\n\nThis way, the data to yield is decided at the compile time by the `SYSTEM` variable you pass to `make`.\nIf you make with `SYSTEM=imperial` - the information you yield will be in an imperial system.\nIn other words, you will yield `visibilityMiles` data instead of `visibility` (meters).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexlnkp%2Fweatherscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexlnkp%2Fweatherscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexlnkp%2Fweatherscript/lists"}