How can i grab text from web site?

Hi,

I need to extract text from a web site.

My web site return a text like this.

{“STATUS”: {“STATUS”: “S”, “when”: 1683149271, “Msg”: “stats”, “api_version”: “1.0.0”}, “INFO”: {“miner_version”: “81.0-2.0.0”, “CompileTime”: “Fri Dec 23 18:42:27 CST 2022”, “type”: “Antminer KA3”}, “STATS”: [{“elapsed”: 116615, “rate_5s”: 175042.24, “rate_avg”: 168130.15, “rate_30m”: 168115.27, “rate_ideal”: 168161.28, “rate_unit”: “GH/s”, “chain_num”: 3, “fan_num”: 4, “fan”: [5880, 5160, 5760, 5760], “hwp_total”: 0.0625, “chain”: [{“index”: 0, “freq_avg”: 640, “rate_ideal”: 56053.76, “rate_real”: 56167.32, “asic_num”: 92, “asic”: “ooooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo ooo”, “temp_pic”: [0, 0], “temp_pcb”: [40, 49], “temp_chip”: [50, 59], “hw”: 4444, “eeprom_loaded”: true, “sn”: “JYZZYPFBCJBJG02XD”}, {“index”: 1, “freq_avg”: 640, “rate_ideal”: 56053.76, “rate_real”: 56071.4, “asic_num”: 92, “asic”: “ooooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo ooo”, “temp_pic”: [0, 0], “temp_pcb”: [39, 48], “temp_chip”: [49, 58], “hw”: 3851, “eeprom_loaded”: true, “sn”: “JYZZYPFBCJBJG01CH”}, {“index”: 2, “freq_avg”: 640, “rate_ideal”: 56053.76, “rate_real”: 55876.54, “asic_num”: 92, “asic”: “ooooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo ooo”, “temp_pic”: [0, 0], “temp_pcb”: [40, 48], “temp_chip”: [50, 58], “hw”: 2872, “eeprom_loaded”: true, “sn”: “JYZZYPFBCJBJG016Y”}]}]}

I need to grab text and pass to a json variable and query temperatures.

Who can help me with this?

How is this related to Blynk?

Pete.

I am Using blynk libraries and I will pass the value to blynk console via virtual pins.

If you want someone to volunteer to write you sketch, or even give you an outline of how you would achieve it, you’re going to need to provide much more info.

Pete.

You have to use JSON library inside your Blynk sketch.

i know. but i can not able to get data from webpage using wificlient. i can not include wificlient.h
which library i need to use?
i am uisng arduino mega with esp8266

I dont know of an HTTP(S) Client Get solution using this hardware setup.

Have you tried the Blynk Webhook functionality?

Pete.

i tried but my web page requires authentiction.
I can open page like this http://user:pass@192.168.1.xxx:1000
when i write url like this webhook gives 401 error.
İ also set basit authentication still gives me 401 error.
why?

Mega is the worst MCU, buy an ESP32 and use HttpClient library.

That’s because you are pointing the webhook to an IP address that is local to your home network. The Blynk server can’t resolve this IP address, because it’s private not public.
You would need to use a DDNS service and an updater client, and port-forward port 1000 to the IP address where your web page sits.

Pete.

Sure my real up is static public Ip.
it’s http://user:pass@193.192.115.112:1100
Still webhook gives me 401 error.
If I use http://193.192.115.112, which is my routers remote access page, it’s ok

If i change hardware I can solve but with mega+esp8266 isnt it possible to make it? I am stuck.

So do you have port 1100 forwarded correctly, inbound and outbound?

as I said earlier…

Pete.

I don’t know if you can find HttpClient library for mega

There should be a way to get response of a web site and pass it to a virtual pin, right?