Go to Post Being rude is easy. Being a compassionate human being takes work. - Joe Johnson [more]
Home
Go Back   Chief Delphi > Other > FIRST-related Organizations > The Blue Alliance
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-02-2008, 23:26
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
[TBA]: API Client Development

TBA currently offers an API client in PHP that can be found here.

I know Eric Haskins has written a .NET port that can be found here for now, and Team 1515 is writing a Rails port. I think myself or Chris Jelly will be working with these guys to make their ports available from the TBA site.

Has anyone else written a port of the Client Library? What issues have you had porting it?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2008, 23:38
CapnKernel CapnKernel is offline
Parse Error on line: Unknown
FRC #1515 (MorTorq)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Beverly Hills
Posts: 13
CapnKernel has a spectacular aura aboutCapnKernel has a spectacular aura about
Re: API Client Development

I just finished a Ruby (on Rails) client library.

Feel free to use it.
Have any questions, comments, bug fixes, complaints, or just want to talk to someone who knows Ruby, contact me via:

AIM/Skype: talk2kern
MSN/Email: talk2kern@gmail.com
Attached Files
File Type: zip tba_ruby.zip (1.7 KB, 106 views)
Reply With Quote
  #3   Spotlight this post!  
Unread 25-02-2008, 10:54
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: API Client Development

I attached a copy of my .net client. Currently the only documentation is the code, but if there is any interest I can finish better documentation.

It requires .net 3.5, and Visual Basic 2008 Express or Visual Studio 2008 or greater.

Currently there are two projects, a class library with the client, and a console app which can be used to query the API. The readme file has instructions how to set your API key in the config file.

I have put the code under the Microsft Public License, so you are free to modify or redistribute it how ever you want.

If anyone has questions, comments, bug reports, ect., please contact me. My Skype, MSN, and e-mail, are in my profile, you can contact me using any of those methods.
Attached Files
File Type: zip EHaskins.TBALib v1.zip (265.4 KB, 104 views)
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 25-02-2008 at 11:26. Reason: Added express edition link
Reply With Quote
  #4   Spotlight this post!  
Unread 25-02-2008, 22:14
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: API Client Development

I attached the compiled version of the code I posted above.
Attached Files
File Type: zip EHaskins.TBALib v1 Bin.zip (19.7 KB, 101 views)
__________________
Eric Haskins KC9JVH
Reply With Quote
  #5   Spotlight this post!  
Unread 25-02-2008, 22:26
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: API Client Development

I've updated the documentation and files available for download at: http://www.thebluealliance.net/tbatv/api/

I'll write a pretty page to wrap around it at some point.
Reply With Quote
  #6   Spotlight this post!  
Unread 28-02-2008, 13:17
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: API Client Development

Here is v1.1 of my library.

There is only one bug fix.
1. When loading matches, some of the matches at the 2007 Florida regional are missing team numbers, and the parser would crash. That has been resolved.
Attached Files
File Type: zip EHaskins.TBALib v1.1.zip (326.6 KB, 104 views)
File Type: zip EHaskins.TBALib v1.1 Bin.zip (19.9 KB, 114 views)
__________________
Eric Haskins KC9JVH
Reply With Quote
  #7   Spotlight this post!  
Unread 28-02-2008, 20:10
CapnKernel CapnKernel is offline
Parse Error on line: Unknown
FRC #1515 (MorTorq)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Beverly Hills
Posts: 13
CapnKernel has a spectacular aura aboutCapnKernel has a spectacular aura about
Re: API Client Development

Also found a bug in my Ruby code when I actually used it in practice for my application.

This'll make the code more Ruby-like and return false if there are no results found but an error does not occur.

Happy coding!
Attached Files
File Type: zip tba.rb.zip (1.8 KB, 115 views)
Reply With Quote
  #8   Spotlight this post!  
Unread 28-02-2008, 20:48
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: API Client Development

Both updated libraries have been added to http://www.thebluealliance.net/tbatv/api/.

Thanks guys!
Reply With Quote
  #9   Spotlight this post!  
Unread 28-02-2008, 22:36
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: API Client Development

Would it be useful to create a SourceForge, CodePlex, GoogleCode, ect, site where we could mantain a record of any client libraries people develop?

Just a thought.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #10   Spotlight this post!  
Unread 29-02-2008, 00:30
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: API Client Development

I'm not sure we're at that level of complexity yet, but it is an idea worth keeping in mind if the number starts to get big or there is much need to change them.
Reply With Quote
  #11   Spotlight this post!  
Unread 07-03-2008, 02:18
Greg McCoy's Avatar
Greg McCoy Greg McCoy is offline
boiler up!
FRC #3940 (CyberTooth)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Kokomo, IN
Posts: 484
Greg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond repute
Send a message via AIM to Greg McCoy
Re: API Client Development

This is very cool stuff...I'm using the TBA API now for the Boilermaker Regional website, and I hope to expand our usage once I have some time to explore all of the possibilities...

I'll try and pay it forward with a Python connector...I've only had my API key for 12 hours or so, so I haven't tested this extensively but it should work fairly well. If you notice any bugs or anything that could be improved, let me know!


Thanks!
Attached Files
File Type: zip tba.zip (1.8 KB, 112 views)
Reply With Quote
  #12   Spotlight this post!  
Unread 25-03-2008, 17:13
Nibbles Nibbles is offline
Interstellar Hitchhiker
AKA: Austin Wright
FRC #0498 (Cobra Commanders)
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2003
Location: Arizona
Posts: 103
Nibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really nice
Re: [TBA]: API Client Development

Quote:
Originally Posted by Greg Marra View Post
TBA currently offers an API client in PHP that can be found here.

...

Has anyone else written a port of the Client Library? What issues have you had porting it?
I noticed other threads with people having problems. PHP5 has this great new thing called Exceptions. If there is an error, it will kill the execution of the script, unless the programmer has a method of catching and handling the exception.
The official PHP client is serverely lacking in error checking, for instance, if the API server returns a blank XML (XHTML, say) document, then no error will pop up.

I'll keep it simple, my edits are public domain. I have not tested this, but it should work.
Code:
function tba_send_request($method, $arguments=array()){
  $api_key = ""; //replace with your API key
  $api_url = "http://thebluealliance.net/tbatv/api.php"; //this should not change
  // prepend the default array elements
  $arguments = array('version'=>1, 'api_key'=>$api_key,'method'=>$method) + $arguments;
  $file = $api_url.'?'.http_build_query($arguments);
  $xml = simplexml_load_file($file);
  // check for a broken connection, bad XML, etc
  if($xml===false) throw new Exception("Bad XML returned getting file $file");
  // check for errors thrown by the server
  if (count($xml->error)){
    throw new Exception("Error generated by API server: ".(string)$xml->error->text, (int)$xml->error->code);
  }else{
    return $xml;
  }
}
While you could put these functions into a class, and have the API key be a property of the object, I would not recommend it (at least for PHP), there is no benefit to using object-oriented programming here (since the most objects you will ever need is one).

Last edited by Nibbles : 25-03-2008 at 17:16. Reason: Added link
Reply With Quote
  #13   Spotlight this post!  
Unread 28-03-2008, 21:15
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: [TBA]: API Client Development

I've been experimenting with the API, and for compatibility reasons I've created a .net 2.0 port of my .net 3.5 client. I haven't done any performance comparisions, so don't ask about that.

The demo console app also has some small improvments, but nothing too major.

EDIT: Added license and readme to source file, and added compiled version.
Attached Files
File Type: zip TBA Test Console net20 bin.zip (19.8 KB, 104 views)
File Type: zip TBA Test Console net20.zip (301.7 KB, 108 views)
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 28-03-2008 at 21:21. Reason: Changed files
Reply With Quote
  #14   Spotlight this post!  
Unread 28-03-2008, 23:49
Nibbles Nibbles is offline
Interstellar Hitchhiker
AKA: Austin Wright
FRC #0498 (Cobra Commanders)
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2003
Location: Arizona
Posts: 103
Nibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really niceNibbles is just really nice
Re: [TBA]: API Client Development

Not to start a flame war, but no one cares about .net or Microsoft's open-source-wannabe-license. Public domain or a simple "Redistribute alike" clause offers more then enough protection.
<rant>Look at Kevin Watsons code, the entire license is three sentences, including "Thanks." And even if we did care about a bigo license, no one uses .net for anything anyways, since the number of platforms I can use it on I can count on one hand, no, one finger!</rant>

On a slightly related note, I was going to code up a test console in php-gtk, but there wasn't enough room to attach php5.dll</irony>

<edit>I remember why I came here: You are not having any problems with server load at all? It takes a measurable amount of time to ping the page for data, are we interested in caching the data at all? You are going to need to send HTTP caching headers first, which I do not see currently (i.e. HTTP/1.1 304 Not Modified)</edit>

Last edited by Nibbles : 29-03-2008 at 00:05.
Reply With Quote
  #15   Spotlight this post!  
Unread 29-03-2008, 00:35
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: [TBA]: API Client Development

I don't normally reply to people when they post something totally unrelated to the current thread, but I thought I'd do you a favor and correct some of your bigger misconceptions.

Quote:
Originally Posted by Nibbles View Post
Not to start a flame war, but no one cares about .net or Microsoft's open-source-wannabe-license. Public domain or a simple "Redistribute alike" clause offers more then enough protection.
Its never a good idea to release code without an accompanying license, both for you and anyone who wants to use it. If I use someone's code which isn't licensed properly I could be leaving myself vulnerable, no matter how small that vulnerability is, its safer to attach a real license, any license, so everybody involved knows their rights and responsibilities.

MsPL just happened to be the first license I saw which had terms I agreed with.

Quote:
Originally Posted by Nibbles View Post
And even if we did care about a bigo license, no one uses .net for anything anyways
That is just not true. For business apps .net is more popular than Java(#2), there are millions of ASP.net web servers, and over 4000 open source projects are hosted on CodeProject.

Quote:
Originally Posted by Nibbles View Post
since the number of platforms I can use it on I can count on one hand, no, one finger!</rant>
Also false, unless you have some serious disfigument, in which case I applogize for the next paragraph. .net currently runs on Linux, Mac, XBox 360, Zune*, and of course Windows. Also some people count the web scenarios seperatly, which includes Windows(IIS or Apache), Linux(Apache), and I believe Mac.


On a side note, did you download my code just so you could complain, or are you a closet .net fan?
* Currently in beta.
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 29-03-2008 at 00:39.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[TBA]: Issues with TBA API FRANK(WGH) The Blue Alliance 7 17-03-2008 11:39
[TBA]: Schedules and TBA API proegssilb The Blue Alliance 3 09-03-2008 15:55
[TBA] The Blue Alliance API cjelly The Blue Alliance 9 24-02-2008 23:37
[TBA] TBA Presents... Soldering and Multimeter Tutorials Greg Marra General Forum 0 27-01-2007 20:15
What FTP Client do you use? sanddrag Website Design/Showcase 31 18-05-2005 20:57


All times are GMT -5. The time now is 19:46.

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