Comments (20)
from abettor.
Hi guys. Maybe due to this (from betfair 18th Nov), which killed our code around the start of Dec:
"Following this announcement from Feb 2019, we are now looking to remove TLS 1.0 support across all other API endpoints. Specifically, any request to the API that isn’t a Login.
Based on our analysis we can see that you are still making requests to the Betfair API using TLS 1.0 from IP address XXXX
We’d like to remove support for TLS 1.0 by Monday 30th November so are notifying you of this so you can make the necessary changes before then."
We've (well, BC, not me) forked this and will send a pull request with changes pretty soon. Might be some other issue you're having though.
from abettor.
@JJHeathview for the record - sort of yes, so we're getting rid of RCurl in favour of httr. I expect B will have something to say at some point.
from abettor.
Apologies, for the delayed reply, I haven't used this code for such a long time now, so it isn't getting any love.
At one point I did start migrating from RCurl to httr. Then I decided actually, I didn't want to buy into the Tidyverse (yep, Datatable rather than dplyr for me), and was thinking of migrating back to RCurl. In short, the chances of me migrating everything to httr is slim. I'd rather force use of newer RCurl and TSL > 1.0.
Have a look at this StackOverflow post covering determining the SSL Version of your RCurl and also how to enforce later versions.
E.g.
RCurl::curlVersion()$ssl_version
Some functions, such as listCountries()
, listClearedOrder()
and listMarketPandL()
were migrated to httr, so it might be worth checking if they still work, when listCompetitions()
, still on RCurl, doesn't.
If someone would like to submit a PR to cover forcing newer versions of TLS > 1.0 with RCurl, I'd be very pleased to merge it.
Also, having said that, if someone keen and actively using this code would like to be added as a maintainer of this repository I'd also be happy to discuss.
from abettor.
Thanks all for the suggestions. I'm a total newbie at all of this so not 100% sure I've completely got this right. But taking listCompetitions()
as an example, is it as "simple" as converting the code
as.list(jsonlite::fromJSON( RCurl::postForm(
into its httr equivalent
httr::content( httr::POST(
?
from abettor.
@gilesdoy had you any success with your proposed method?
from abettor.
It does work, yes, if you recode the relevant parts of listMarketBook, listCompetitions, listMarketCatalogue and listMarketTypes
into the httr
structure. Not been able to turn that into a new/separate package though
from abettor.
If you submit a pull request here I will do my best to merge it. If you're not familiar with that, simply paste the enhanced functions into Issue comments and I will integrate them.
from abettor.
Hi all,
I have attempted to update OpenSSL to version1.1.1a, however RCurl doesn't seem to recognise it. When using RCurl::curlVersion()
it shows the version as OpenSSL/1.0.0o.
When I check the OpenSSL version of the curl package using curl::curl_version()
it does recognise it. Presumably this means libcurl is pointed at the updated OpenSSL version. Is there a way to point RCurl to the updated OpenSSL?
If not, will try and convert to httr.
Thx, Chris
from abettor.
Has anyone cracked this yet? I now have working copies on my own machine and would be prepared to try a pull request if there is nothing currently underway. (I've not done this before).
from abettor.
from abettor.
from abettor.
@Soccerama managed to resolve it.
Here's the code that needs to be changed:
listMarketCatalogueOps <- jsonlite::toJSON(jsonlite::unbox(listMarketCatalogueOps))
product <- Sys.getenv("product")
token <- Sys.getenv("token")
listMarketCat <- httr::content(
httr::POST(url = "https://api.betfair.com/exchange/betting/json-rpc/v1",
config = httr::config(ssl_verifypeer = sslVerify),
body = listMarketCatalogueOps,
httr::add_headers(Accept = "application/json",
"X-Application" = product,
"X-Authentication" = token)), as = "text")
listMarketCat <- jsonlite::fromJSON(listMarketCat)
if (is.null(listMarketCat$error))
as.data.frame(listMarketCat$result)
else ({
if (!suppress)
warning("Error- See output for details")
as.data.frame(listMarketCat$error)
})
If you do it like this the output is a nice dataframe which you can then easily manipulate.
from abettor.
If you do it like this the output is a nice dataframe which you can then easily manipulate.
Bradley, when I copy your code across it doesn't seem to work for me.
Also, I found listCurrentOrders more difficult to work with - have you tried that one?
from abettor.
Okay, they're all working now! I will tidy it all up and aim to do a pull request in the next few days.
from abettor.
Brilliant! Is the output all good?
from abettor.
Thanks everyone who contributed here and especially @Soccerama . I've merged the pull request. The code all looked like it made sense, but to be completely honest I didn't personally run the code against any API queries. I'm open to more feedback if anyone finds bugs.
There may be some versioning things to take care of. The DESCRIPTION file states httr (>= 1.4.0)
but it may be that this needs to change.
from abettor.
Thanks. I did some testing but far from best practice so wouldn't be surprised if there were some issues.
How do we get a new release so it automatically rolls out to R?
Actually, I'm happy to go through and update the rest of the functions prior to doing a release. Shouldn't take too long.
from abettor.
I never packaged this for CRAN, so you should be able to install direct from the GitHub Master Branch with:
# install.packages("devtools")
devtools::install_github("phillc73/abettor")
library("abettor")
Let me know if it doesn't work or you have problems.
from abettor.
Really appreciate everyone's help in making this work over the last week, apologies I've not been able to help more. Thank you!
from abettor.
Related Issues (20)
- Regenerate Package Documentation HOT 1
- Support Spanish, Italian and Swedish end points HOT 1
- listRunnerBook Fails to Generate Documentation HOT 1
- placeOrders function does not include all fields HOT 10
- Rename checkBalance and listMarketPandL Functions HOT 2
- placeOrders not working correctly for some optional fields HOT 2
- getAccountStatement uses legacyData fields and code is messy HOT 1
- listCurrentOrders does not include all parameters HOT 1
- listClearedOrders is not correctly putting results into a dataframe and is instead providing one very long row. HOT 2
- Minor API change to listCurrentOrders - week commencing 9 August HOT 1
- Check valid login status HOT 5
- placeOrder function seems to not pass customerOrderRef on MARKET_ON_CLOSE bets HOT 1
- Help pulling market prices HOT 1
- Minor issue when trying to cancel individual betIds. Simple code fix has been proposed. HOT 3
- getAccountStatement crash with dead heat HOT 4
- getAccountStatement not returning all columns
- listMarketBook function returning identical results HOT 8
- The placeOrders function doesn't pass the handicap field to the API HOT 1
- date range in getAccountStatement not working correctly
- Not able to login HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abettor.