Jump to content

outl4w

New Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by outl4w

  1. currently using php ver. 5.3.28
  2. sorry for double posting but if a admin/mod would merge this with the my op....I guess you have a message editing time limit. just wanted to add the original code: <?php 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 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_PageContent']/div[@id='rn_AnswerTop']/h1[@id='rn_Summary']"; $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 { display: inline-block; height: 14px; line-height: 14px; font-size: 14px; font-weight: 600; padding: 4px 4px; margin-top: 4px; letter-spacing:0.5px; color: #FAF9F7 !important; vertical-align: middle !important; cursor:default; text-shadow: 0 0 0 transparent, 0px -3px 0px #333; } .xboxstatus a{ color:#D4D4D4; font-weight:600; background: #c9de96; /* Old browsers */ background: -moz-linear-gradient(top, #c9de96 0%, #8ab66b 44%, #398235 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c9de96), color-stop(44%,#8ab66b), color-stop(100%,#398235)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #c9de96 0%,#8ab66b 44%,#398235 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #c9de96 0%,#8ab66b 44%,#398235 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #c9de96 0%,#8ab66b 44%,#398235 100%); /* IE10+ */ background: linear-gradient(to bottom, #c9de96 0%,#8ab66b 44%,#398235 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c9de96', endColorstr='#398235',GradientType=0 ); /* IE6-9 */ padding: 6px !important; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -webkit-box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); -moz-box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); border:groove 1px #000; } .psntitle { display: inline-block; height: 16px; line-height: 16px; font-size: 14px; font-weight: 600; padding: 4px 4px; margin-top: 4px; letter-spacing:0.5px; color: #FAF9F7 !important; vertical-align: middle !important; cursor:default; text-shadow: 0 0 0 transparent, 0px -3px 0px #333; } .psnstatus a{ color:#D4D4D4; font-weight:600; background: rgb(181,189,200); /* Old browsers */ background: -moz-linear-gradient(top, rgba(181,189,200,1) 0%, rgba(130,140,149,1) 36%, rgba(40,52,59,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(181,189,200,1)), color-stop(36%,rgba(130,140,149,1)), color-stop(100%,rgba(40,52,59,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5bdc8', endColorstr='#28343b',GradientType=0 ); /* IE6-9 */ line-height: 1.95; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -webkit-box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); -moz-box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); box-shadow: 6px 6px 20px 0px rgba(0,0,0,0.75); border:groove 1px #000; padding: 6px !important; } </style> <span class='psntitle'> PSN Status: </span><br /><span class='psnstatus'> <a href='https://support.us.playstation.com/app/answers/detail/a_id/237/'>" . $PSNstatus . "</a></span><br /><br /><span class='xboxtitle'> XBL Status: </span><br /><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'> " . $XBOXSocialAndGamingStatus . "</a></span><br /><br /><span class='xboxtitle'> XBL Core Status: </span><br /><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'>" . $XBOXLiveCoreStatus . "</a></span>"; echo $output; ?> I'm more of a css guy and this is sorta my first dive into the phpool by adapting the php from templates...got the xbl script right.
  3. just joined after hoping to find an answer and to find other useful snippets. this script use to work and now since PSN reformatted their status page...can't seem to get it working again. the previous PSN url - http://support.us.playstation.com/app/answers/detail/a_id/237/ snippet error_reporting(E_ERROR); $PSN_url = 'https://status.playstation.com/en-us/'; $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_PageContent']/div[@id='rn_AnswerTop']/h1[@id='rn_Summary']"; $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); what this is suppose to do is search the PSN status page and look for the content and return the results to a slide out tab on my site.....similar to how it scrapes the xbl status page. I've done the "view source" on the PSN page and experimented with all the "id's/class's" ie "alert-content" but can't narrow it down....just wondering if any php guru's here could help out. any help is greatly appreciated...
×
×
  • 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.