First thing you should know about this is that it scrapes the information for the sites you provided. I haven't done research but it would be better if Sony and Microsoft provided a data feed for the info.
If either company change the html on the provided sites then this widget will stop working so don't be surprised if it breaks 6 months from now. if it does break it is super easy to fix.
Last some people consider this method unethical but in this case I don't think it is a big deal. You aren't exactly getting great content.
Here is the code. If you want to change how it looks feel free to add some CSS and HTML in there. You need to make sure you put in within the quotes where the break tags are or where the titles are.
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[@id='rn_PSNStatusTicker_Intermittent_11']/p/span";
$PSN_rows = $PSNxpath->query($PSN_query);
//PSN Status
foreach ($PSN_rows as $PSN_object){
$PSNstatus = $PSN_object->childNodes->item(1)->nodeValue;
}
$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 = "PSN Status: " .
$PSNstatus . "<br /><br />XBOX Status: " . $XBOXSocialAndGamingStatus . "<br /><br />XBOX Live Core Status: " . $XBOXLiveCoreStatus;