Go Back   Developer Program Forum > Sports API > Ruby

Ruby A place to discuss and trade ideas relating to the dynamic, open source programming language Ruby with a focus on simplicity and productivity.

Post Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2012, 06:25 AM
Scrumpy Dog Scrumpy Dog is offline
Member
 
Join Date: Nov 2009
Posts: 47
Default Rails RESTful JSON API Integration App

Put together a proof of concept Rails App that acts as RESTful JSON middleware app for the SOAP API.

Very much proof of concept, to highlight my Ruby Betfair Gem.

You can check out both here:

https://github.com/lukebyrne/betfair
https://github.com/lukebyrne/betfair-json-api

The gem also has a working bot in it that will lay odds on horses.
  #2  
Old 04-04-2012, 09:11 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 514
Default

Quote:
Originally Posted by Scrumpy Dog View Post
Put together a proof of concept Rails App that acts as RESTful JSON middleware app for the SOAP API.
Very much proof of concept, to highlight my Ruby Betfair Gem.
There is a problem, Betfair forbids any proxies and middlewares. Any proxy should be stricly for personal use I beleive. Transforming XML into JSON and vice versa is trivial, I had to do it as JSON is a native object representaion in JavaScript applications.

Although RESTful json API is great, it will increase API call delays. Can you please suggest what are the reasons to have such a proxy? SOAP is shit, but not that shit to avoid it adding the additional complexity level.
  #3  
Old 04-04-2012, 11:30 PM
Scrumpy Dog Scrumpy Dog is offline
Member
 
Join Date: Nov 2009
Posts: 47
Default

Quote:
Originally Posted by AlgoTrader View Post
There is a problem, Betfair forbids any proxies and middlewares. Any proxy should be stricly for personal use I beleive. Transforming XML into JSON and vice versa is trivial, I had to do it as JSON is a native object representaion in JavaScript applications.

Although RESTful json API is great, it will increase API call delays. Can you please suggest what are the reasons to have such a proxy? SOAP is shit, but not that shit to avoid it adding the additional complexity level.
I wrote this Rails App primarily as a proof of concept to see whether I could and to demonstrate what I thought a RESTful JSON API may look like for the Exchange.

I am aware that it will increase API call delays.

A practical use may be if you were writing a mobile app for BF and needed a web app to act in the middle. I imagine as hard as SOAP is with traditional computing environments, it must be an absolute nightmare on native IOS and Android to create libraries to interact with BF.
  #4  
Old 04-05-2012, 04:19 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 514
Default

Quote:
Originally Posted by Scrumpy Dog View Post
I imagine as hard as SOAP is with traditional computing environments, it must be an absolute nightmare on native IOS and Android to create libraries to interact with BF.
I never tried Adndroid, but for IOS implementing SOAP is simple. I can send the source code in Objective-C.

Cocoa has good collections (arrays, dictionaries), have several robust XML parsers (DOM, SAX) and XML serializers. It also have quite good HTTP (asynchronous and easy to use NSURLConnection). It has everything to make SOAP without much worries. IOS also allows use C/C++ without limitations so if one hates Objective-C he can use C/C++.

Betfair anyway does not allow applications working through proxies, so it will block the app in AppStore.
  #5  
Old 04-05-2012, 07:17 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 514
Default

Quote:
Originally Posted by Scrumpy Dog View Post
A practical use may be if you were writing a mobile app for BF and needed a web app to act in the middle. I imagine as hard as SOAP is with traditional computing environments, it must be an absolute nightmare on native IOS and Android to create libraries to interact with BF.
There is another issue that is not technical. Supposedly you have a proxy REST service working at proxy.supertrader.com. I bought the supertrader application for iphone and I will somehow learn that my betfair password is going not to betfair but to proxy.supertrader.com. It's a matter of trust. Then proxy owner can get access to lots of accounts data, it's like sharing my credit card data with some service that I cannot trust for sure.

The same problem is with desktop apps, but first there is the "certification" process for such applications and second is the app works on a local computer and I can check which sites the app connects to.

Last edited by AlgoTrader; 04-05-2012 at 07:19 AM
Post 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:21 PM.


BETFAIR® and the BETFAIR LOGO are registered trade marks of The Sporting Exchange Limited. Data on Betfair website(s) (including pricing data) is protected by © and database rights. It may not be used for any purpose without a licence. © The Sporting Exchange Limited. All rights reserved.