In general you can structure your program to keep a connection alive.
Also, for keeping track of something in a website, do you need to download all of its HTML, and spontaneously? Or is there a more efficient way, when suppose you know exactly the change is going to happen? |
Not in general, although this is necessary on occasion: if you're making a habit of scraping HTML for links, Perl is your friend.
Ideally, the server provides an API that can be called (usually after authentication) by issuing the proper HTTP requests. The result would be exactly what you ask for, often in JSON or some other format (XML, plain text).
Obviously if you know when the change occurs, just wait until after the update to ask for the result. If only the server knows when the change occurs, you could either
a.) have the client poll the server reasonably often, or
b.) have the server notify the client when the change occurs, for example using Web-sockets or HTTP callbacks.
So if I'm connecting to a website that often, maybe even connecting every single second, SPONTANEOUSLY for DAYS TOGETHER, would the website consider that as harmful and block me?
|
Many websites rate-limit requests and connections. Egregious violations can sometimes get you blocked (and your authentication revoked, etc.)