Go to Post You know, if I was John V-Neun I would get a copyright on my name! - Jay H 237 [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 03-09-2011, 00:13
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Match Results API from team 862

Behold, the Lightning Robotics Match Results Retrieval System, version 1.2p. Seeing as the Blue Alliance API is no longer supported, we decided it would be an amazing idea if we created our own php-based system for displaying match results.

This system allows you to retrieve your team's match results in real time as your competitions unfold, and display them on your website. It allows parents and those who can't make it to your competitions to see your match results without the clutter of other teams' matches. It will even auto-update in their browser.

You can read about, and download, the system here.

If you have any comments, questions, or suggestions, I'd love to see them! Especially if you manage to improve the system!

To see the system in action on our own site, go here.

I did my best to make this NOT sound like an advertisement. How'd I do?

EDIT: Updated to version 1.2p.
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.

Last edited by quinxorin : 03-09-2011 at 19:07. Reason: changed post title to be more useful
  #2   Spotlight this post!  
Unread 03-09-2011, 21:20
David Anderson David Anderson is offline
Registered User
AKA: Brandon Brewer
FRC #0862 (Lightning Robotics)
 
Join Date: Sep 2011
Rookie Year: 2009
Location: United States
Posts: 4
David Anderson is an unknown quantity at this point
Re: Match Results API from team 862

Looks good, this should make it easier for other teams to keep track of match data on their sites, I DEFINITELY recommend they try it out.
  #3   Spotlight this post!  
Unread 04-09-2011, 08:05
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Match Results API for your website

Yeah, this looks very cool and convenient. I'll be sure to check it out when I get a free couple of hours.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
  #4   Spotlight this post!  
Unread 04-09-2011, 19:53
lemiant's Avatar
lemiant lemiant is offline
the Dreamer
AKA: Alex
FRC #4334 (Alberta Tech Alliance)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Calgary, AB, Canada
Posts: 562
lemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond repute
Re: Match Results API for your website

I really like the functionality, but the IMHO the display on your website is a bit tacky. Maybe some rounded corners or AJAX refresh would help.
  #5   Spotlight this post!  
Unread 04-09-2011, 20:10
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Re: Match Results API for your website

Quote:
Originally Posted by lemiant View Post
I really like the functionality, but the IMHO the display on your website is a bit tacky. Maybe some rounded corners or AJAX refresh would help.
It DOES have AJAX refresh!
It works by loading a cached copy first, then uses AJAX to replace it with an updated version once the server is done scraping it from FIRST. It then refreshes automatically every 60 seconds. If you click the "Refresh" link (which disappears once the AJAX does it's thing) it will force the page to be updated server-side before being sent to the browser.

It doesn't normally scrape before transmitting due to the several-second lag caused by scraping the data from FIRST.

Also, that very obvious notice about our team's first meeting isn't normally there, obviously. That makes it look rather ugly.
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.

Last edited by quinxorin : 04-09-2011 at 20:13.
  #6   Spotlight this post!  
Unread 04-09-2011, 20:24
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,055
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Match Results API for your website

Quote:
Originally Posted by quinxorin View Post
It DOES have AJAX refresh!
It works by loading a cached copy first, then uses AJAX to replace it with an updated version once the server is done scraping it from FIRST. It then refreshes automatically every 60 seconds. If you click the "Refresh" link (which disappears once the AJAX does it's thing) it will force the page to be updated server-side before being sent to the browser.

It doesn't normally scrape before transmitting due to the several-second lag caused by scraping the data from FIRST.

Also, that very obvious notice about our team's first meeting isn't normally there, obviously. That makes it look rather ugly.
So, you are scraping the data off the FIRST site how often? Are you storing any data on your servers (aside from basic caching)? Basically, are you being a good citizen or not?
__________________




.
  #7   Spotlight this post!  
Unread 04-09-2011, 20:46
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Re: Match Results API for your website

Quote:
Originally Posted by Andrew Schreiber View Post
So, you are scraping the data off the FIRST site how often? Are you storing any data on your servers (aside from basic caching)? Basically, are you being a good citizen or not?
Yes - the data is stored on our server, that's what I meant. The system only scrapes the data from our competitions, and most importantly, only when users are actually viewing the page. The data is scraped from FIRST a maximum of once every minute (every hour right now, since it's not competition season). If you use this tool, you can set that number to be whatever you would like, and of course configure it to scrape from your own competitions.

This is a good point, I'm glad you brought it up.
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.

Last edited by quinxorin : 04-09-2011 at 20:54.
  #8   Spotlight this post!  
Unread 04-09-2011, 20:56
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,055
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Match Results API for your website

Quote:
Originally Posted by quinxorin View Post
Yes - the data is stored on our server, that's what I meant. The data is scraped from FIRST a maximum of once every minute (every hour right now, since it's not competition season). It only scrapes the data from our competitions, and only when users are actually viewing the page. If you use this tool, you can set that number to be whatever you would like, and of course configure it to scrape from your own competitions.

This is a good point, I'm glad you brought it up.
I would suggest dumping that lower limit to 6 minutes since that is pretty much the lowest turn around rate for matches. (That is what FRCFeed's caching was set to before Google App Engine popped out of preview and it would have started costing me too much to run it there)
__________________




.
  #9   Spotlight this post!  
Unread 04-09-2011, 21:23
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Re: Match Results API for your website

Quote:
Originally Posted by Andrew Schreiber View Post
I would suggest dumping that lower limit to 6 minutes since that is pretty much the lowest turn around rate for matches. (That is what FRCFeed's caching was set to before Google App Engine popped out of preview and it would have started costing me too much to run it there)
Hmmm, now that is a good idea.
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.
  #10   Spotlight this post!  
Unread 04-09-2011, 21:56
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,055
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Match Results API for your website

Quote:
Originally Posted by quinxorin View Post
Hmmm, now that is a good idea.
You other option, and one I just never got around to implementing, would be to check the Last-Modified header and see if it has changed since your cached version.
__________________




.
  #11   Spotlight this post!  
Unread 04-09-2011, 21:42
lemiant's Avatar
lemiant lemiant is offline
the Dreamer
AKA: Alex
FRC #4334 (Alberta Tech Alliance)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Calgary, AB, Canada
Posts: 562
lemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond reputelemiant has a reputation beyond repute
Re: Match Results API for your website

Quote:
Originally Posted by quinxorin View Post
It DOES have AJAX refresh!
It works by loading a cached copy first, then uses AJAX to replace it with an updated version once the server is done scraping it from FIRST. It then refreshes automatically every 60 seconds. If you click the "Refresh" link (which disappears once the AJAX does it's thing) it will force the page to be updated server-side before being sent to the browser.

It doesn't normally scrape before transmitting due to the several-second lag caused by scraping the data from FIRST.

Also, that very obvious notice about our team's first meeting isn't normally there, obviously. That makes it look rather ugly.
Ahh, ok. I just clicked the link, saw the page refresh and then assumed.
  #12   Spotlight this post!  
Unread 04-09-2011, 21:59
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Version 1.3p

I just updated the system to version 1.3p. The previous discussion about scrape times made me realize (about five minutes ago) that the scrape time limit was per user, so if ten people were viewing the page, then it would scrape ten times as fast, even though each individual user would still see it only as often as the scrape time permitted - an obvious flaw. But it's fixed now, and the system will not scrape data from FIRST if it hasn't been long enough.

I kind of hurried this out, so it hasn't had the proper bug testing. It was a simple change and shouldn't have caused any, but if anything stops working, please tell me.

Another minor change: the "last updated on" notice is now at the bottom, not the top.

There have been fifteen downloads at the time of this posting.

Quote:
Originally Posted by Andrew Schreiber View Post
You other option, and one I just never got around to implementing, would be to check the Last-Modified header and see if it has changed since your cached version.
Unfortunately, that still means that the connecting has to occur, because the header isn't sent from FIRST unless an http request is sent. The only benefit of using that header, that I can think of, would be to reduce load on the server implementing the API, because then it wouldn't have to process the data. If you look at the function library, it uses a seriously ginormous number of string operations and array manipulations. Am I totally wrong about the usage of that header?
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.

Last edited by quinxorin : 04-09-2011 at 22:27.
  #13   Spotlight this post!  
Unread 08-09-2011, 11:50
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: Match Results API for your website

This is great!

My question, however, is regarding the number of events you can have.

PHP Code:
'teamevents' => 
      array (
      
//Add the event codes for your team here. 
        
=> 'gg',
        
=> 'mi',
        
=> 'gl',
        
=> 'Newton',
      ), 
I added the fourth event, and the page no longer seems to cache and update. I'm not awesome with PHP, so I'm wondering if three events is the max, hardcoded number in the script, or if I should be able to add the fouth event.

Thanks again for coding this!
__________________

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
  #14   Spotlight this post!  
Unread 08-09-2011, 15:56
quinxorin quinxorin is offline
Mentor now :(
AKA: Ian Pudney
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Lightning Robotics
Posts: 148
quinxorin will become famous soon enough
Re: Match Results API for your website

Quote:
Originally Posted by KeatonM View Post
This is great!

My question, however, is regarding the number of events you can have.
...
I added the fourth event, and the page no longer seems to cache and update. I'm not awesome with PHP, so I'm wondering if three events is the max, hardcoded number in the script, or if I should be able to add the fouth event.

Thanks again for coding this!
Interesting. Yes, you should be able to add all the events you attended. I just tried it, and it worked fine for me. PHP is often set up differently on different servers, however, which means that it behaves differently.

It does work with just three, right?

Try the following:
1. Make sure that your team number is properly defined in the config file. It should read:
PHP Code:
$teamnumber=27
2. Try adding the following line to the config file while testing, but be sure to remove it before publication:
PHP Code:
$bypass_scrape_protection=true
That line has to do with the scrape protection system that I implemented in the most recent version (see above). It was hurried out, so it still has flaws that I will fix. That line will disable it.
3. Check to make sure the www2.usfirst.org domain is online. They must be doing some upgrades or something, because it seems to be going down for short periods every few days, or at least it did when I was building this system. It got frustrating.
4. If it's still not working, add the following line to the top of the matchresults_config.php file:
PHP Code:
error_reporting(E_ERROR E_WARNING E_PARSE); 
then use the system again. That will make PHP spit out any errors that might have occurred. If it's something about the max execution time (or time limit) being exceeded, then use:
PHP Code:
set_time_limit(60); 
to set the max execution time to one minute instead of the default 30 seconds. This means that your server doesn't have a fast enough connection (unlikely) or enough processing power to handle four events in 30 seconds. If it gives an error about a memory limit, use the similar function:
PHP Code:
ini_set('memory_limit''256M'); 
to increase the memory limit to an outrageous amount.

Normally, you'd use matchresults_viewrecord.php. When testing, try using matchresults_output_show.php. That is the most basic one - it won't use AJAX Refresh or even save to the cache, just get you your data.
__________________
"Sed res docuit id verum esse, quod in carminibus Appius ait, fabrum esse suae quemque fortunae."
- Every man is the architect of his own fortune.

Last edited by quinxorin : 08-09-2011 at 15:59.
  #15   Spotlight this post!  
Unread 12-09-2011, 11:41
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: Match Results API for your website

Yes, it works with just three! I didn't mention that!

Everything was correctly configured, and the page matchresults_output_show.php did show all 4, so my guess is that the cache process doesn't work on my server (shared hosting with Arvixe.com).

My PHP configuration is Memory_limit = 256M, max_execution_time = 600
__________________

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
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:56.

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