Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 01-09-2015, 02:15 PM
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for all your hard work so far Andrew.
Reply With Quote
  #12  
Old 01-12-2015, 12:36 AM
AndrewSimm AndrewSimm is offline
 
Join Date: Sep 2006
Location: Atlanta, GA
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
2 благодарности(ей) от:
CAG CheechDogg, Manoel J?nior
  #13  
Old 01-12-2015, 05:23 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good stuff Andrew this also works as a forum block ... thank you !!!
Reply With Quote
  #14  
Old 01-12-2015, 02:36 PM
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent! Thank you very much Andrew!
Reply With Quote
Благодарность от:
CAG CheechDogg
  #15  
Old 01-12-2015, 02:45 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CharlieDelta View Post
Excellent! Thank you very much Andrew!

And thank you too CharlieDelta for asking about doing this !!!!
Reply With Quote
Благодарность от:
CharlieDelta
  #16  
Old 01-13-2015, 02:05 AM
AndrewSimm AndrewSimm is offline
 
Join Date: Sep 2006
Location: Atlanta, GA
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
CharlieDelta
  #17  
Old 01-13-2015, 02:01 PM
OUTL4W OUTL4W is offline
 
Join Date: May 2013
Location: Gettysburg, Pa
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AndrewSimm View Post
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
Reply With Quote
Благодарность от:
CharlieDelta
  #18  
Old 01-13-2015, 02:29 PM
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #19  
Old 01-13-2015, 02:47 PM
AndrewSimm AndrewSimm is offline
 
Join Date: Sep 2006
Location: Atlanta, GA
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by OUTL4W View Post
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.
Reply With Quote
  #20  
Old 01-13-2015, 10:17 PM
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:50 AM.


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.08274 seconds
  • Memory Usage 2,302KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete