Yes it looks like the div id changes based off of the status. I am working on a solution.
--------------- Added [DATE]1421207122[/DATE] at [TIME]1421207122[/TIME] ---------------
Ok I fixed the PSN issue but can't fully test it until the network changes status. It should work though. I had to get the contents of that status a little differently so by doing so it grabs the whole line so I had to then use str_replace to prevent PSN Status from showing twice.
I also add in some basic CSS, you can change it to whatever fits your site, and last I made the statuses links to the appropriate pages.
PHP Code:
$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; }