Ok I can't check if it isset because that isn't the problem. That error just means for whatever reason during that time the ink wouldn't load. There is nothing we can do about the link not loading but we can suppress the warning so it doesn't show. If the link doesn't load then the status should just be left blank. The code below fixes 2 things. First it grabs the PSN status you guys want and 2nd it surpresses the error if it can't load the URL.
PHP Code:
error_reporting(E_ERROR);
$PSN_url = 'http://support.us.playstation.com/app/answers/detail/a_id/237/'; $PSNhtml = file_get_contents($PSN_url); $PSNdom = new DOMDocument(); @$PSNdom->loadHTML($PSNhtml); $PSNxpath = new DOMXPath($PSNdom);
//PSN Status foreach ($PSN_rows as $PSN_object){ $PSNstatus = $PSN_object->childNodes->item(0)->nodeValue; } $PSNstatus = str_replace('PSN Status:', '', $PSNstatus);
$XBOX_url = 'http://support.xbox.com/en-US/xbox-live-status'; $XBOXhtml = file_get_contents($XBOX_url); $XBOXdom = new DOMDocument(); @$XBOXdom->loadHTML($XBOXhtml); $XBOXxpath = new DOMXPath($XBOXdom);
//Xbox Social And Gaming $XBOXSocialAndGaming_query = "/html/body[@id='DocumentBody']/div[@id='bodycolumn']/div[@id='BodyContent']/div[@class='liveStatusPage']/div[2]/ul[@class='core']/li[@id='SocialandGaming']/div[@class='item']/h3"; $XBOXSocialAndGaming_rows = $XBOXxpath->query($XBOXSocialAndGaming_query);
//Xbox Social And Gaming loop foreach ($XBOXSocialAndGaming_rows as $XBOXSocialAndGaming_object){ $XBOXSocialAndGamingStatus = $XBOXSocialAndGaming_object->childNodes->item(1)->nodeValue; }
//Xbox Live Core Services $XBOXLiveCore_query = "/html/body[@id='DocumentBody']/div[@id='bodycolumn']/div[@id='BodyContent']/div[@class='liveStatusPage']/div[2]/ul[@class='core']/li[@id='XboxLiveCoreServices']/div[@class='item']/h3"; $XBOXLiveCore_rows = $XBOXxpath->query($XBOXLiveCore_query);
//Xbox Live Core Status foreach ($XBOXLiveCore_rows as $XBOXLiveCore_object){ $XBOXLiveCoreStatus = $XBOXLiveCore_object->childNodes->item(1)->nodeValue; }