Jump to content




Http question


  • You cannot reply to this topic
6 replies to this topic

#1 lieudusty

  • Members
  • 419 posts

Posted 21 January 2013 - 12:07 PM

Hi everyone :D

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 Eric

  • Members
  • 92 posts
  • LocationUK

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.

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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 lieudusty

  • Members
  • 419 posts

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 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 21 January 2013 - 04:06 PM

View Postlieudusty, 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.
If the change is done server side before it is sent to the client then thats fine... however if it is done client side js like the status' at help.mojang.com then it cant be done...

#6 lieudusty

  • Members
  • 419 posts

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 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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