Jump to content


Photo

Need advice, not code.


  • Please log in to reply
3 replies to this topic

#1 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 06 July 2006 - 07:35 PM

So I'm working on a bittorrent search engine.

Here's a sample of what i've gotten done so far http://comptechcompu...rch/tsearch.php



What I want to do is get rid of iframes altogether. However, if a site were to not respond to an http search query request it would hold up the whole page until cURL spit out an error or the site finally responded to the request.

My question:

How would I go about finding out if a torrent site (a page in particular)is responding to http requests. Is there a way to send a short request for maybe http headers (?) instead of the whole page, and set a timeout limit of maybe 3 seconds so it doesn't hold up the page's loading terribly slow if in fact the site isn't responding?

A simple ping would not suffice, of course, because it doesn't not tell if an http server is up on it.





#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 06 July 2006 - 08:16 PM

I've never used CURL myself, but it looks like you can do this based on the manual page:

curl_setopt($cUrl, CURLOPT_TIMEOUT, 'timeout_in_seconds');

Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 06 July 2006 - 08:32 PM

Thanks! I looked through it but I didn't know if there was a way to check to see if it timed out then I realized there's a way to get outputted errors. Hopefully this works!


#4 dagnasty

dagnasty
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 07 July 2006 - 03:56 AM

when the page times out it doesnt output an error. However, when a host cannot be found ex. www.dasfklfsdklfdsljsfd.com it does. Kinda sucks :(

Ideas anyone?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users