Go Down

Topic: How to turn on a led when a number in a web page changes? (Read 306 times) previous topic - next topic

Treidd

Hi guys!! I'm a novicer with Arduino and I'm interested in turning on a led when a number (for example, the number of connected users in a forum) changes. I don't know if this is possible and I can't figure out how to aim to that specific number and turn on the led when it changes. The page i want to do this with, is not of my own.
PD: Sorry for my english, I'm learning.

J-M-L

first check by connecting in your web browser and reading source code of the web page if the number of users is in plain text or if there is some sort of black magic javascript / ajax / whatever happening that updates this number.

check also if this is a simple HTTP request or if this is HTTPS

if the data you want to read is available in plain text then learn how to send a request to get a web page first - there are plenty of tutorials available (search for arduino get web page)

Once you get this working you need to send the request to your web site, parse the stream of data coming at you to identify the value you are looking for and convert it into a number. Once you have your number, compare to your threshold and turn on or off your LED

then repeat every x seconds. (some web site will kick you out if you ping too often and there are copyright laws as well depending on what you want to scrape from the web page)

Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

Go Up