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 12-21-2012, 05:58 AM
Scrumpy Dog Scrumpy Dog is offline
Member
 
Join Date: Nov 2009
Posts: 47
Default Next version of the Betfair API - JSON

Hi All,

I have created a private google group to manage any collaborators and contributions on the next version of the Betfair Ruby Gem.

In addition we will also be building a new SDK to utilise the gem and build trading/betting bots with possibly a web based interface to create and manage these.

Also trying to create a Ruby community thing within this wider Betfair Developers Community.

If you are a Rubyist and wish to get involved either ask for an invite via
https://groups.google.com/forum/?fro...r-api-rubyists

or email me

lukeb at lukebyrne dot com

Hope to get some more collaborators.

Cheers,

Luke
  #2  
Old 12-21-2012, 07:16 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 523
Default

The new Betfair API will open several new prospects that could be difficult or impossible before.

Point one. Using SOAP V6 API without a library was a difficult thing. Now I need no "library" to access BF. The Betfair python examples show how to use a new API in library-less style. What the library do is just adds "jsonrpc":"2.0", "id":something, "method" : "xxx" and adds two HTTP headers - X-Application and X-Authenticate. Lib is still convenient to forget that stuff but a lib is a thin layer now and can be done in a couple of days with a single guy.

Point two. To make a Betfair web application there is no need in PHP, Ruby, Python or Perl. One needs just browser, HTML and JavaScript. Browser can connect to Betfair itself and invoking any call is a couple of lines in JavaScript. No intermediate server needed.

How to connect BF from browser's HTML:
Code:
$.ajax("https://beta-api.betfair.com/json-rpc", 
   { type:"POST", 
      headers: {"X-Application":"xxx", "X-Authentication":"yyy"},
      data: {jsonrpc:"2.0", id:nextid++, method:"name", params: {...} }
}).done( function() {
   // result handler
   alert("Invocation is done");
}) ;
Using $.ajaxSetup we can put pretty static headers that are common among all the calls.

My understanding is we can say goodbye to server coding completely for BF web applications. New BF API can be treated as AJAX service, JSON is a native JavaScript format. In fact, JSON is nothing but a serialized JavaScript object and no language understands JSON better than JavaScript.

Yes, I am the author of Betfair lib too, but I do aware the value of our work is much devaluated
__________________
Betfair Bots Made Easy
https://github.com/AlgoTrader/betfair-sports-api/wiki

Last edited by AlgoTrader; 12-21-2012 at 08:15 AM
  #3  
Old 12-22-2012, 09:27 PM
MrChameleon MrChameleon is offline
Member
 
Join Date: Apr 2009
Posts: 36
Default

Hi Luke

I'm interested, will email you.

Best

Chris
  #4  
Old 12-27-2012, 05:08 AM
Scrumpy Dog Scrumpy Dog is offline
Member
 
Join Date: Nov 2009
Posts: 47
Default

Hi Chris,

Have I added you to the group yet?

Cheers,

Luke
  #5  
Old 12-27-2012, 08:52 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 523
Default

Not sure what kind of SDK you were talking about. If it's something like
session.placeOrders(...);
Then it is pretty out of interest.

I desperatly need SDK with functions like this:
market.getSelectionThatWillWin();
market.getTrueProbabilityForSelection(selectionId) ;

To be serious, the problem is everybody discuss API details but nobody discuss trading strategies and secrets. I think, nobody wants to discuss trading secrets.

My Christmas trading secret: in the old SOAP API we have no selectionIds in getAllMarkets response. When placing 1.01 we need do it really fast. Invoking getMarket or getMarketProfitAndLoss is 10-15ms at best. I use RAM cached database (redis) to map selection names into selection ids, so it takes ~1ms to get the selectionIds for the selection names (extracted from getAllMarkets's menuPath). Fortunately the new API has no such problems.
__________________
Betfair Bots Made Easy
https://github.com/AlgoTrader/betfair-sports-api/wiki
  #6  
Old 12-27-2012, 06:17 PM
MrChameleon MrChameleon is offline
Member
 
Join Date: Apr 2009
Posts: 36
Default

Hi Luke.

Yes thanks.

Best

Chris
  #7  
Old 12-28-2012, 06:24 AM
Scrumpy Dog Scrumpy Dog is offline
Member
 
Join Date: Nov 2009
Posts: 47
Smile Please stop posting off topic

Dear AlgoTrader,

You will notice that the topic of this thread is for people who are interested in Ruby and developing things for the Betfair API using Ruby.

I applaud the efforts in your Node work for the Betfair API, I have looked at your code base and it looks good (although I know nothing about Node, and no, that isn't an invitation to tell me the virtues of it).

Your wiki is a little lacking towards the end on the topics are the most interesting to people, such as placing and cancelling bets.
https://github.com/AlgoTrader/betfair-sports-api/wiki

If you look at the "SDK" https://github.com/lukebyrne/betfair_sdk (I have loosely called it that because I didn't know what else to call it) I have provided code on how to create bots using the Ruby Betfair Gem that quite a few of the Ruby community on this forum helped with.

I provided a couple of obvious ones such as "Lay the Favourite". It might not be great but it has helped some people getting into Betfair botting and provided off forum discussion about botting strategies.

I am definitely interested in your Node implementation if there is at least one simple bot I could implement and play around with, perhaps the 'Lay the Favourite' for example.

Please note this isn't an a slight or criticism towards you or your work, nor a request for more info on the number milliseconds it takes to implement a keepAlive request 4000 times. Just a simple man's observations.

If I can provide some guidance on my experience in trying to get some take up for your work within this forum (and in turn get the trading tips and SDK methods you so desperately desire):

1. Provide some solid examples of how to implement your API code with a simple bot
2. Foster relationships with people who are interested in the language you program in, its too hard
to try and convert people.
3. Stay on topic in threads and don't interject unless its absolutely necessary. If necessary add to the conversation rather than trying to steer it towards discussion of your library

I wish you all the best for the New Year and your botting success on Betfair.

Kind regards,

Luke

PS - You are welcome to come to Ruby if you like, its awesome!
  #8  
Old 12-28-2012, 07:20 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 523
Default

I absolutly have no desire to bring happiness to the people around the world. I also don't care how many people use Node.js and how they succeed. I just do what I need and share it with the community. There is no point in promoting the free lib. Why to care about? The Betfair API for Node.js will never bring me any money. Python, Ruby, Node.js, perl - they all quite good for building simple Betfair apps and technology is out of interest. Placing bets is easy. The new Betfair API is even much easier. What is difficult is to build an app that makes bets and increase the balance.

PS What is the purpose of your attemts of building the community? I have 27 stars in github, I won't cry if I had zero, I won't be happy If I had a thousand. The stars mean nothing. The exchange does not care if I have huge IQ, prestigeous university or exellent programming skills. What I learned from trading is that it does not matter what I think about myself, it does matter what number is there in availableBalance field
__________________
Betfair Bots Made Easy
https://github.com/AlgoTrader/betfair-sports-api/wiki

Last edited by AlgoTrader; 12-28-2012 at 07:58 AM
  #9  
Old 12-28-2012, 07:38 AM
AlgoTrader AlgoTrader is offline
Senior Member
 
Join Date: Mar 2012
Posts: 523
Default

As to Ruby. I am a technology unopinionated guy. I am not interested in programming itself, I need things done.

API stuff is simple, we have dozens of libs in a dozen of languages. Five years ago I thought that if I had a robust library I could easily build a bot. Oops, nothing can be further from truth. I now have an exellent lib, emulator and I know API with great details. And I still have troubles with stable profit.

PS I like Ruby, it's a good language.
__________________
Betfair Bots Made Easy
https://github.com/AlgoTrader/betfair-sports-api/wiki

Last edited by AlgoTrader; 12-28-2012 at 07:42 AM
  #10  
Old 12-29-2012, 08:04 AM
MarkL MarkL is offline
BDP Team
 
Join Date: Oct 2008
Posts: 347
Default

Quote:
Originally Posted by AlgoTrader View Post
I desperatly need SDK with functions like this:
market.getSelectionThatWillWin();
market.getTrueProbabilityForSelection(selectionId) ;
I'll put it on the backlog. No promises on when we'll be able to deliver that feature though.
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 06:37 AM.


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.