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 Query
$PSN_query = "/html/body[@id='scea_body']/div[@id='wrap']/div[@class='boxshadow']/div[@id='main']/div[@id='search_main_box']/div[contains(@id, 'rn_PSNStatusTicker')]/p
";
$PSN_rows = $PSNxpath->query($PSN_query);
//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;
}
$output = "
<style>
.xboxtitle {
font-weight:600;
}
.xboxstatus a{
color:#107C10;
}
.psntitle {
font-weight:600;
}
.psnstatus a{
color:#665cbe;
}
</style>
<span class='psntitle'>PSN Status:</span><span class='psnstatus'> <a href='https://support.us.playstation.com/app/answers/detail/a_id/237/'>" .
$PSNstatus . "</a></span><br /><br /><span class='xboxtitle'>XBOX Status:</span><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'> " . $XBOXSocialAndGamingStatus . "</a></span><br /><br /><span class='xboxtitle'>XBOX Live Core Status: </span><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'>" . $XBOXLiveCoreStatus . "</a></span>";