diff options
author | Indrajith K L | 2022-12-03 17:00:20 +0530 |
---|---|---|
committer | Indrajith K L | 2022-12-03 17:00:20 +0530 |
commit | f5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch) | |
tree | 2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/old/examples/get_weather/README.md | |
download | cli-tools-windows-master.tar.gz cli-tools-windows-master.tar.bz2 cli-tools-windows-master.zip |
Diffstat (limited to 'v_windows/v/old/examples/get_weather/README.md')
-rw-r--r-- | v_windows/v/old/examples/get_weather/README.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/v_windows/v/old/examples/get_weather/README.md b/v_windows/v/old/examples/get_weather/README.md new file mode 100644 index 0000000..be2695d --- /dev/null +++ b/v_windows/v/old/examples/get_weather/README.md @@ -0,0 +1,23 @@ +# get_weather +get_weather is a very simple web crawler. +Its goal is to get a weather forecast from caiyunapp.com. + +# Compile and Run + +Use this to generate an executable and then launch the web crawler. +```bash +v get_weather.v +./get_weather +``` + +As a convenience, you can also compile and launch the web crawler directly. +```bash +v run get_weather.v +``` + +In this project we use http.fetch() to get a http.Response, with a +custom user-agent and then we use json.decode() to decode the json +response to struct. +We also use a `[skip]` attribute to skip certain fields in the response, +that we don't need and use a `[json: result]` attribute to specify that +our struct field is named differently from the incoming json response. |