Go to Post Now, our team did meet, but there wasn't much inspiring going on. Unless you call pegging me with more darn poof balls exciting. - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-03-2012, 11:39
KeatonM's Avatar
KeatonM KeatonM is offline
Registered User
FRC #0027 (Team RUSH)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Dallas, TX
Posts: 83
KeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant futureKeatonM has a brilliant future
Re: Extracting Data from FRC-Spy

The main problem is with your URL. '?xml=2.xml' should just be '?xml=2'.

You can also add '&teams=4096' after the 2 to filter to a specific team.

Here's some sample code and a demo that (I think) provides the information you're looking for.

Demo - I use team 27, since your team has no results in FRC-Spy yet - http://keatonismy.name/dev/frcspy.php

Code:
PHP Code:
<?php
//$allmatches = simplexml_load_file("http://www.chiefdelphi.com/forums/frcspy.php?xml=2&teams=4096");  
$allmatches simplexml_load_file("http://www.chiefdelphi.com/forums/frcspy.php?xml=2&teams=27");  


//print_r($allmatches);


$i 0;
foreach (
$allmatches as $row){
echo 
"<b>Event: </b>" $allmatches->match[$i]->event "<br />";
echo 
"<b>Match Type: </b>" $allmatches->match[$i]->typ "<br />";
echo 
"<b>Match No.: </b>" $allmatches->match[$i]->mch "<br />";
echo 
"<b>Red 1: </b>" $allmatches->match[$i]->red1 "  ";
echo 
"<b>Red 2: </b>" $allmatches->match[$i]->red2 "  ";
echo 
"<b>Red 3: </b>" $allmatches->match[$i]->red3 "  <br />";
echo 
"<b>Blue 1: </b>" $allmatches->match[$i]->blue1 "  ";
echo 
"<b>Blue 2: </b>" $allmatches->match[$i]->blue2 "  ";
echo 
"<b>Blue 3: </b>" $allmatches->match[$i]->blue3 "  <br />";
echo 
"<b>Red Score: </b>" $allmatches->match[$i]->rfin "  ";
echo 
"<b>Blue Score: </b>" $allmatches->match[$i]->bfin "<br />";

echo 
"<br />";

$i++;
}

?>

If you uncomment the print_r line, you'll see the raw XML for your query.


Also, unless you're set on coding this from scratch yourself, team 862 has a nice system for retrieving match results with simple configuration. Check out http://lightningrobotics.com/Content...agename=lrmrrs and the CD thread http://www.chiefdelphi.com/forums/sh...d.php?t=104249
__________________

Team RUSH 27 Alumni

Personal/Resume: http://keatondm.com
Social: http://twitter.com/keatonm27 & http://facebook.com/kdmantz


Anyone who has never made a mistake has never tried anything new.
- ALBERT EINSTEIN
  #2   Spotlight this post!  
Unread 15-03-2012, 11:46
Dkt01's Avatar
Dkt01 Dkt01 is offline
Programming Mentor
AKA: David
FRC #1756 (Argos)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Peoria, Il
Posts: 145
Dkt01 will become famous soon enough
Re: Extracting Data from FRC-Spy

Thank you so much! I figured I made some simple mistake, but that's part of learning.
  #3   Spotlight this post!  
Unread 15-03-2012, 17:40
Dkt01's Avatar
Dkt01 Dkt01 is offline
Programming Mentor
AKA: David
FRC #1756 (Argos)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Peoria, Il
Posts: 145
Dkt01 will become famous soon enough
Re: Extracting Data from FRC-Spy

Actually, after more digging and debugging, my issue was that I can't directly access external websites on this server (something like that). By using curl, my problem was solved. Thanks for the explanation on how to make FRC-spy filter by team, though.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi