Giter Site home page Giter Site logo

Unable to retrieve any list about abettor HOT 20 CLOSED

gilesdoy avatar gilesdoy commented on June 7, 2024
Unable to retrieve any list

from abettor.

Comments (20)

JJHeathview avatar JJHeathview commented on June 7, 2024

from abettor.

statsgeeknz avatar statsgeeknz commented on June 7, 2024

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.

statsgeeknz avatar statsgeeknz commented on June 7, 2024

@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.

phillc73 avatar phillc73 commented on June 7, 2024

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.

gilesdoy avatar gilesdoy commented on June 7, 2024

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.

jackkelleher avatar jackkelleher commented on June 7, 2024

@gilesdoy had you any success with your proposed method?

from abettor.

gilesdoy avatar gilesdoy commented on June 7, 2024

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.

phillc73 avatar phillc73 commented on June 7, 2024

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.

roseypro avatar roseypro commented on June 7, 2024

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.

Soccerama avatar Soccerama commented on June 7, 2024

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.

Soccerama avatar Soccerama commented on June 7, 2024

from abettor.

Soccerama avatar Soccerama commented on June 7, 2024

from abettor.

bradley-pearson6597 avatar bradley-pearson6597 commented on June 7, 2024

@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.

Soccerama avatar Soccerama commented on June 7, 2024

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.

Soccerama avatar Soccerama commented on June 7, 2024

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.

bradley-pearson6597 avatar bradley-pearson6597 commented on June 7, 2024

Brilliant! Is the output all good?

from abettor.

phillc73 avatar phillc73 commented on June 7, 2024

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.

Soccerama avatar Soccerama commented on June 7, 2024

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.

phillc73 avatar phillc73 commented on June 7, 2024

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.

gilesdoy avatar gilesdoy commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.