vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   PSN & XBox Live Server Status Widget (https://vborg.vbsupport.ru/showthread.php?t=316255)

CharlieDelta 01-09-2015 02:15 PM

Thanks for all your hard work so far Andrew.

AndrewSimm 01-12-2015 12:36 AM

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


CAG CheechDogg 01-12-2015 05:23 AM

Good stuff Andrew this also works as a forum block ... thank you !!!

CharlieDelta 01-12-2015 02:36 PM

Excellent! Thank you very much Andrew!

CAG CheechDogg 01-12-2015 02:45 PM

Quote:

Originally Posted by CharlieDelta (Post 2532113)
Excellent! Thank you very much Andrew!


And thank you too CharlieDelta for asking about doing this !!!!

AndrewSimm 01-13-2015 02:05 AM

No problem, let me know if you have any questions or want it dressed up. It should be fairly easy to add css to it. If it every stops working you just need to update query which includes the xpath. There are chrome plugins that help identify the xpath to an element.

OUTL4W 01-13-2015 02:01 PM

Quote:

Originally Posted by AndrewSimm (Post 2532186)
No problem, let me know if you have any questions or want it dressed up. It should be fairly easy to add css to it. If it every stops working you just need to update query which includes the xpath. There are chrome plugins that help identify the xpath to an element.

def works as is....but been trying to dress this up a lil with css...but no matter where I put the class name within the <br> tags...it breaks...



Thanks andrew and CharlieD for getting this done

CharlieDelta 01-13-2015 02:29 PM

I added some simple bold tags for now to dress up a little and will eventually like to add some css later but would it be possible to add a link to both the psn and xbox pages on the status output?

AndrewSimm 01-13-2015 02:47 PM

Quote:

Originally Posted by OUTL4W (Post 2532295)
def works as is....but been trying to dress this up a lil with css...but no matter where I put the class name within the <br> tags...it breaks...



Thanks andrew and CharlieD for getting this done

don't use " " instead use ' '

I will create a sample when I get home later this evening. I will also make the output links.

CharlieDelta 01-13-2015 10:17 PM

1 Attachment(s)
So I just noticed that the widget is blank for PSN. I checked the PSN site and it is offline.
Something may have changed.
Attachment 151616
Attachment 151617


All times are GMT. The time now is 02:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01259 seconds
  • Memory Usage 1,758KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete