Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Deploying Flask App with nba_py #91

Closed
worldofnick opened this issue Aug 15, 2017 · 3 comments
Closed

Deploying Flask App with nba_py #91

worldofnick opened this issue Aug 15, 2017 · 3 comments

Comments

@worldofnick
Copy link

worldofnick commented Aug 15, 2017

Has anyone sucecssfully deplpyed a flask app that uses nba_py? I have used Heroku and pythonanywhere and both times it doesn't work when I try to request game information. It just times out.

On Heroku when I open the command line and type scoreboard = nba_py.Scoreboard(month=2, day=21, year=2015) the command never executes just hangs there.

@bttmly
Copy link

bttmly commented Aug 15, 2017

NBA.com seems to block known IP address blocks from cloud hosting providers, including AWS and Heroku

#88

@worldofnick
Copy link
Author

@bttmly Do you know of anyway to get around this?

@bttmly
Copy link

bttmly commented Aug 16, 2017

Many endpoints allow a JSONP API, which can be accessed directly by a web client. When you do that, the requesting IP address is that of the client's own computer, so you circumvent this restriction. This would mean your app would have to run in the browser though; not sure what your use case is.

Otherwise you can host your application on a provider that NBA doesn't block. I just ran a request to NBA through a Node.js client from a server hosted by Linode and it worked (disclaimer: I couldn't get a similar curl command to work, no idea why).

Shameless plug: I wrote a Node.js/browser NBA client in JavaScript which supports JSONP: https://github.com/bttmly/nba

EDIT: Not sure if the npm installation of that package currently supports browsers. Ping me if you need help on that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants