thinghttp json parse string get more value.

3 views (last 30 days)
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 Comments
Sachin
Sachin on 20 Mar 2023
Could you please explain what do you want ?
Safak Agustoslu
Safak Agustoslu on 23 Mar 2023
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":

Sign in to comment.

Accepted Answer

Sachin
Sachin on 23 Mar 2023
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 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!