I'm wondering of theres a way to wait for a site to change. So instead of putting http.get in a loop waiting for the site to change, is there a more efficient way of doing this without spamming http?
Http question
Started by lieudusty, Jan 21 2013 12:07 PM
6 replies to this topic
#1
Posted 21 January 2013 - 12:07 PM
Hi everyone 
I'm wondering of theres a way to wait for a site to change. So instead of putting http.get in a loop waiting for the site to change, is there a more efficient way of doing this without spamming http?
I'm wondering of theres a way to wait for a site to change. So instead of putting http.get in a loop waiting for the site to change, is there a more efficient way of doing this without spamming http?
#2
Posted 21 January 2013 - 12:43 PM
That's not how the internet works.
The best you can do (at all) is open a persistent connection, but that's not possible with just HTTP GET and POST. You need some sort of socket API.
The best you can do (at all) is open a persistent connection, but that's not possible with just HTTP GET and POST. You need some sort of socket API.
#3
Posted 21 January 2013 - 01:21 PM
The only reason to do a http request in a loop is so that you can try to make sure you get a response if possible. if you got a response you would break the loop, else you would try say 3 more times or something before giving up and telling the user that it failed...
#4
Posted 21 January 2013 - 03:57 PM
Well I'm making a program and I need to to continuously check a site to see if it had a change.
#5
Posted 21 January 2013 - 04:06 PM
lieudusty, on 21 January 2013 - 03:57 PM, said:
Well I'm making a program and I need to to continuously check a site to see if it had a change.
#6
Posted 21 January 2013 - 04:28 PM
Yeah like I have a php script thats going to update server side. How would I keep checking if the site changed without spamming http.get(). Is there a way to do it?
#7
Posted 21 January 2013 - 04:30 PM
not that I know of... maybe just do a timer and have it refresh every say 10 seconds... then it isn't spamming and its refreshing at a moderate interval...
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











