kawhi 0.2.1 → 0.2.2
raw patch · 5 files changed
+20/−11 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +3/−3
- changelog.md +4/−0
- kawhi.cabal +3/−3
- library/Data/NBA/Stats.hs +9/−4
- stack.yaml +1/−1
README.md view
@@ -1,6 +1,6 @@ # Kawhi : stats.NBA.com library 🏀 -[](https://hackage.haskell.org/package/kawhi) [](https://travis-ci.org/hamsterdam/kawhi)+[](https://hackage.haskell.org/package/kawhi) [](https://travis-ci.org/thunky-monk/kawhi) A Haskell library for working with [NBA Stats](http://stats.nba.com) data. NBA Stats contains rich data, but accessing it is difficult and tedious. Kawhi helps to automate the data retrieval, allowing users to focus on statistics. @@ -11,5 +11,5 @@ To get started: 1. [Get Haskell](https://haskell-lang.org/get-started). If you've never done any computer programming, this could be challenging. [Never give up!](https://www.instagram.com/p/BENA9hpN_wL/)-2. Read the [guide](https://github.com/hamsterdam/kawhi/blob/master/guide.md).-3. Check out the [example](https://github.com/hamsterdam/kawhi/tree/master/example).+2. Read the [guide](https://github.com/thunky-monk/kawhi/blob/master/guide.md).+3. Check out the [example](https://github.com/thunky-monk/kawhi/tree/master/example).
changelog.md view
@@ -1,5 +1,9 @@ # Changelog +## 0.2.2++Updated to add HTTP headers required by NBA Stats.+ ## 0.2.1 Updated to support [aeson-1.0.0.0](https://hackage.haskell.org/package/aeson-1.0.0.0).
kawhi.cabal view
@@ -1,8 +1,8 @@ name: kawhi-version: 0.2.1+version: 0.2.2 synopsis: stats.NBA.com library description: Functions and types for interacting with stats.NBA.com-homepage: https://github.com/hamsterdam/kawhi+homepage: https://github.com/thunky-monk/kawhi license: MIT license-file: LICENSE author: Aaron Taylor@@ -63,4 +63,4 @@ source-repository head type: git- location: https://github.com/hamsterdam/kawhi+ location: https://github.com/thunky-monk/kawhi
library/Data/NBA/Stats.hs view
@@ -49,6 +49,7 @@ import Data.Monoid ((<>)) import qualified Data.Text as Text import qualified Network.HTTP.Client as HTTP+import qualified Network.HTTP.Simple as HTTP import qualified Safe {- |@@ -248,14 +249,18 @@ get :: (MonadHttp.MonadHttp m, Catch.MonadThrow m) => StatsPath -> StatsParameters -> m (HTTP.Response LBS.ByteString)-get path params = do- request <- HTTP.parseRequest $ Char8.unpack $ "http://stats.nba.com/stats/" <> path- MonadHttp.performRequest $ HTTP.setQueryString params request+get path params =+ modifyRequest <$> HTTP.parseRequest (Char8.unpack $ "http://stats.nba.com/stats/" <> path)+ >>= MonadHttp.performRequest+ where+ modifyRequest =+ HTTP.setRequestHeaders [("Accept-Language","en-us"), ("Accept", "application/json")]+ . HTTP.setQueryString params {- $use The following is a working example of getting some "advanced statistics", split by month, for the San Antonio Spurs 2015-2016 regular season. - To learn how to find the NBA Stats values, like 'teamdashboardbygeneralsplits', for this example, read the <https://github.com/hamsterdam/kawhi/blob/master/guide.md guide>.+ To learn how to find the NBA Stats values, like 'teamdashboardbygeneralsplits', for this example, read the <https://github.com/thunky-monk/kawhi/blob/master/guide.md guide>. @ import qualified Data.Aeson as Aeson
stack.yaml view
@@ -1,5 +1,5 @@ # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)-resolver: nightly-2016-09-15+resolver: lts-8.10 # Packages to be built packages: