|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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.
|
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
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. Last edited by quinxorin : 04-09-2011 at 20:13. |
|
#4
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
|
|
#5
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
This is a good point, I'm glad you brought it up. Last edited by quinxorin : 04-09-2011 at 20:54. |
|
#6
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
|
|
#7
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
|
|
#8
|
|||
|
|||
|
Re: Match Results API for your website
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.
|
|
#9
|
||||
|
||||
|
Re: Match Results API for your website
Quote:
|
|
#10
|
|||
|
|||
|
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. 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? Last edited by quinxorin : 04-09-2011 at 22:27. |
|
#11
|
||||
|
||||
|
Re: Match Results API for your website
This is great!
My question, however, is regarding the number of events you can have. PHP Code:
Thanks again for coding this! |
|
#12
|
|||
|
|||
|
Re: Match Results API for your website
Quote:
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:
PHP Code:
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:
PHP Code:
PHP Code:
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. Last edited by quinxorin : 08-09-2011 at 15:59. |
|
#13
|
||||
|
||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|