I was trying to use Matthew Combatti’s Weather Underground Class for getting the local weather conditions for my app. He posted the project file at:
link text
When you run the project and request the “Conditions,” you get the conditions all jammed together is a TextField like what is shown below.
[quote]?{? “response”: {? “version”:“0.1”,? “termsofService”:“http://www.wunderground.com/weather/api/d/terms.html”,? “features”: {? “conditions”: 1? }??}? ,?“current_observation”: {???“image”: {???“url”:“http://icons.wxug.com/graphics/wu2/logo_130x80.png",???“title”:"Weather Underground”,???“link”:“http://www.wunderground.com”???},???“display_location”: {???“full”:“Spartanburg, SC”,???“city”:“Spartanburg”,???“state”:“SC”,???“state_name”:“South Carolina”,???“country”:“US”,???“country_iso3166”:“US”,???“zip”:“29301”,???“magic”:“1”,???“wmo”:“99999”,???“latitude”:“34.93458176”,???“longitude”:"-81.96445465",???“elevation”:“251.00000000”???},???“observation_location”: {???“full”:“I-26 at Reidville Road, Spartanburg, South Carolina”,???“city”:“I-26 at Reidville Road, Spartanburg”,???“state”:“South Carolina”,???“country”:“US”,???“country_iso3166”:“US”,???“latitude”:“34.910179”,???“longitude”:"-81.998116",???“elevation”:“779 ft”???},???“estimated”: {???},???“station_id”:“KSCSPART1”,???“observation_time”:“Last Updated on September 20, 9:53 AM EDT”,???“observation_time_rfc822”:“Tue, 20 Sep 2016 09:53:02 -0400”,???“observation_epoch”:“1474379582”,???“local_time_rfc822”:“Tue, 20 Sep 2016 09:53:50 -0400”,???“local_epoch”:“1474379630”,???“local_tz_short”:“EDT”,???“local_tz_long”:“America/New_York”,???“local_tz_offset”:"-0400",???“weather”:“Clear”,???“temperature_string”:“75.0 F (23.9 C)”,???“temp_f”:75.0,???“temp_c”:23.9,???“relative_humidity”:“82%”,???“wind_string”:“Calm”,???“wind_dir”:“North”,???“wind_degrees”:351,???“wind_mph”:0.0,???“wind_gust_mph”:0,???“wind_kph”:0,???“wind_gust_kph”:0,???“pressure_mb”:“1020”,???“pressure_in”:“30.11”,???“pressure_trend”:"+",???“dewpoint_string”:“69 F (21 C)”,???“dewpoint_f”:69,???“dewpoint_c”:21,???“heat_index_string”:“NA”,???“heat_index_f”:“NA”,???“heat_index_c”:“NA”,???“windchill_string”:“NA”,???“windchill_f”:“NA”,???“windchill_c”:“NA”,???“feelslike_string”:“75.0 F (23.9 C)”,???“feelslike_f”:“75.0”,???“feelslike_c”:“23.9”,???“visibility_mi”:“10.0”,???“visibility_km”:“16.1”,???“solarradiation”:"–",???“UV”:“3”,“precip_1hr_string”:“0.00 in ( 0 mm)”,???“precip_1hr_in”:“0.00”,???“precip_1hr_metric”:" 0",???“precip_today_string”:“0.00 in (0 mm)”,???“precip_today_in”:“0.00”,???“precip_today_metric”:“0”,???“icon”:“clear”,???“icon_url”:“http://icons.wxug.com/i/c/k/clear.gif",???“forecast_url”:“http://www.wunderground.com/US/SC/Spartanburg.html”,???“history_url”:“http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KSCSPART1”,???“ob_url”:“http://www.wunderground.com/cgi-bin/findweather/getForecast?query=34.910179,-81.998116”,???“nowcast”:"”??}?}?
[/quote]
I was wondering if anyone knew how to extract this text into a more readable form, so certain weather conditions can be extracted and redisplayed in a neat format such as:
Temperature: -------
Wind Speed: ------
Wind Direction: -----
ect…
Any suggestions would be greatly appreciated.