Trocergian
Registered User.
- Local time
- Today, 08:35
- Joined
- Apr 6, 2009
- Messages
- 16
I am using a wep API to get some weather data. It opens a web page with a text string similar to this:
{"count":1,"data":[{"app_temp":107.9,"aqi":43,"city_name":"Fate","clouds":4,"country_code":"US","datetime":"2023-07-13:20","dewpt":74.9,"dhi":120.98,"dni":915.14,"elev_angle":67.43,"ghi":957.76,"gust":22.5,"h_angle":25.7,"lat":32.9432,"lon":-96.3904,"ob_time":"2023-07-13 20:12","pod":"d","precip":0,"pres":988,"rh":50,"slp":1007.89026,"snow":0,"solar_rad":957.7,"sources":["rtma","radar","satellite"],"state_code":"TX","station":"F4376","sunrise":"11:27","sunset":"01:35","temp":96.1,"timezone":"America/Chicago","ts":1689279151,"uv":9.523339,"vis":9.9,"weather":{"description":"Clear sky","code":800,"icon":"c01d"},"wind_cdir":"S","wind_cdir_full":"south","wind_dir":190,"wind_spd":14.6}]}
My question is how do I get a web page's text into a text string so I can parse the information?
(I know how to parse the string once I have it, it's somehow getting it into the variable.)
I was wondering is there is some variation of a strVariable = webpageobject("https://whatever.page.info") type of thing?
{"count":1,"data":[{"app_temp":107.9,"aqi":43,"city_name":"Fate","clouds":4,"country_code":"US","datetime":"2023-07-13:20","dewpt":74.9,"dhi":120.98,"dni":915.14,"elev_angle":67.43,"ghi":957.76,"gust":22.5,"h_angle":25.7,"lat":32.9432,"lon":-96.3904,"ob_time":"2023-07-13 20:12","pod":"d","precip":0,"pres":988,"rh":50,"slp":1007.89026,"snow":0,"solar_rad":957.7,"sources":["rtma","radar","satellite"],"state_code":"TX","station":"F4376","sunrise":"11:27","sunset":"01:35","temp":96.1,"timezone":"America/Chicago","ts":1689279151,"uv":9.523339,"vis":9.9,"weather":{"description":"Clear sky","code":800,"icon":"c01d"},"wind_cdir":"S","wind_cdir_full":"south","wind_dir":190,"wind_spd":14.6}]}
My question is how do I get a web page's text into a text string so I can parse the information?
(I know how to parse the string once I have it, it's somehow getting it into the variable.)
I was wondering is there is some variation of a strVariable = webpageobject("https://whatever.page.info") type of thing?