Jump to content

Yahoo 999 Error.


Ninjakreborn

Recommended Posts

If your working with Yahoo API, or Yahoo Scraping, is there a way to detect the 999 error. I have an App that deals heavily with Yahoo scraping.  However, Yahoo after awhile has the 999 error.  What I want to do is detect when it returns the error, serialize all the arrays up into a database, and allow the client to try it again later when Yahoo has removed it's blocking restriction (after about an hour).

 

So, what I have thought about is doing a standard detection script. Just to see if the text 999 was found.

 

SO the function that I use to get data from Yahoo, after awhile it returns:

Warning: file_get_contents(http://siteexplorer.search.yahoo.com/search?p=http://http://www.seomarketing.com&bwm=i&bwmf=u&bwms=p&fr2=seo-rd-se&b=1501) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 999 Unable to process request at this time -- error 999 in /var/www/vhosts/seomarketing.com/httpdocs/seotools/competitiveanalysis/functions.php on line 86

What I want to do is supress that error (Which I can do with Error Reporting, or the @ symbol.  That is easy. What I also want to do is put up a conditional.

 

if (file_get_contents($url) throws a warning) {

// Do some database work.

}

I can't figure out the best way to approach this. Any advice?

Link to comment
Share on other sites

You'll have to find some way of reading what the response, if any, was. file_get_contents() only returns the body so you'll have to figure out a way of accessing the headers (to determine whether the HTTP status was 999).  The PHP manual page for file_get_contents() is a good start. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.