thinghttp json parse string get more value.

조회 수: 1 (최근 30일)
Safak Agustoslu
Safak Agustoslu 2023년 3월 18일
댓글: Safak Agustoslu 2023년 3월 23일
I want to get 2-3 of the results at once using parse string in thingHTTP. Is it possible?
I can get 1 value using PArse string, but I want to get several values together. I want to get date and time together from the results in this example.
Results is :
{ "date": "03-18-2023", "milliseconds_since_epoch": 1679147976499, "time": "01:59:36 PM" }
How can I write parse string box in thinghttp?
Thanks
  댓글 수: 2
Sachin
Sachin 2023년 3월 20일
Could you please explain what do you want ?
Safak Agustoslu
Safak Agustoslu 2023년 3월 23일
In the THINGHTTP section, in the parse string box,
I can get 1 variable from JSON string. So I can get the "date" variable.
But I want to be able to get the "date" and "time" variables together. For example, I write "date,time" or "date/time" in the parse string box and it gives an error.
What I want to do is to get together as 03-18-2023 - 01:59:36 PM.
Or
Have I made a request in this type of string once. To get EpochDate, temperature, and rain status together.
Thanks
It's part of the JSON string. not all.
Example.
{"Headline":{"EffectiveDate":"2023-03-23T02:00:00-04:00","EffectiveEpochDate":1679551200,"Severity":3,"Text":"Expect rainy weather late Wednesday night through this afternoon","Category":"rain","EndDate":"2023-03-23T20:00:00-04:00","EndEpochDate":1679616000,"MobileLink":"http://www.accuweather .com/en/ca/toronto/m5h/daily-weather-forecast/55488?lang=en-us","Link":"http://www.accuweather.com/en/ca/toronto/m5h/daily -weather-forecast/55488?lang=en-us"},"DailyForecasts":[{"Date":"2023-03-22T07:00:00-04:00","EpochDate":1679482800,"Temperature" :{"Minimum":{"Value":40.0,"Unit":"F","UnitType":18},"Maximum":{"Value":42.0,"Unit":"F","UnitType" :18}},"Day":{"Icon":7,"IconPhrase":"Cloudy","HasPrecipitation":false},"Night":{"Icon":18,"IconPhrase":"Rain", "HasPrecipitation":true,"PrecipitationType":"Rain","PrecipitationIntensity":"Light"},"Sources":["AccuWeather"],"MobileLink":"http://www.accuweather.com/en/ ca/toronto/m5h/daily-weather-forecast/55488?lang=en-us","Link":"http://www.accuweather.com/en/ca /toronto/m5h/daily-weather-forecast/55488?lang=en-us"},{"Date":"2023-03-23T07:00:00-04:00","EpochDate":1679569200,"Temperature ":{"Minimum":{"Value":30.0,"Unit":"F","UnitType":18},"Maximum":{"Value":48.0,"Unit":"F","UnitType ":18}},"Day":

댓글을 달려면 로그인하십시오.

채택된 답변

Sachin
Sachin 2023년 3월 23일
Hi
I understand that you want more values using parse string in thinghttp.
I assume that your URL response is JSON. Since you want to get multiple values at once So I suggest[AK1] you to use the ‘webread’ function in MATLAB. This function will help you to get all the JSON object values at once.
webread('your url')
This will return a struct with fields.
For more information about ‘webread’ refer to:
  댓글 수: 5
Safak Agustoslu
Safak Agustoslu 2023년 3월 23일
Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 JSON Format에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by