parse data from simple page [feature request]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mikrom
Normal user
Posts: 13
Joined: 19 Apr 2017, 19:19

parse data from simple page [feature request]

#1 Post by mikrom » 12 May 2017, 19:03

also tried to search, but no luck

is possible to read (JSON in my case) from some webpage (by HTTP GET) and get values from it?

I am still using my ESP's standalone without any "brain" (except sending data to web (and display them (and web provide last data in simple JSON)))

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: parse data from simple page [feature request]

#2 Post by DeNB3rt » 15 May 2017, 15:44

Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

sjfaustino
New user
Posts: 8
Joined: 03 May 2017, 18:42

Re: parse data from simple page [feature request]

#3 Post by sjfaustino » 16 May 2017, 20:55

mikrom wrote: 12 May 2017, 19:03 is possible to read (JSON in my case) from some webpage (by HTTP GET) and get values from it?
Possible, yes. I'm doing it on a new plugin that I'm developing but the problem is the possible complexity.

Could you give us a URL of a existing page and what EXACTLY you would like to read from it?

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: parse data from simple page [feature request]

#4 Post by danmero » 23 May 2017, 12:56

From *nix use wget and awk to parse the json.

Code: Select all

wget -qO- http://<device_ip>/json | awk '!/TaskName/ && /: /{x=gsub("[\",]","",$0);gsub(": ","=",$0);print}'
If you want to use the variable in your script just use declare.

Code: Select all

declare $(wget -qO- http://<device_ip>/json | awk '!/TaskName/ && /: /{x=gsub("[\",]","",$0);gsub(": ","=",$0);print}')
Regards,

mikrom
Normal user
Posts: 13
Joined: 19 Apr 2017, 19:19

Re: parse data from simple page [feature request]

#5 Post by mikrom » 06 Jun 2017, 11:03

sjfaustino wrote: 16 May 2017, 20:55
mikrom wrote: 12 May 2017, 19:03 is possible to read (JSON in my case) from some webpage (by HTTP GET) and get values from it?
Possible, yes. I'm doing it on a new plugin that I'm developing but the problem is the possible complexity.

Could you give us a URL of a existing page and what EXACTLY you would like to read from it?
https://tmep.mikrom.cz/loznice/vystup-json.php for example

pitrio
Normal user
Posts: 26
Joined: 23 Apr 2018, 16:49

Re: parse data from simple page [feature request]

#6 Post by pitrio » 10 Feb 2019, 12:23

dear all,

I saw this old post about "parse data from simple page", I'm interested about this, can you tell me if the plugin it was developed? If so can you tell me how I can do to implement it on ESPeasy?

thank you so much

ricc

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests