packages feed

stooq-api 0.2.0.0 → 0.3.0.0

raw patch · 3 files changed

+13/−9 lines, 3 filesdep +stringsearchPVP ok

version bump matches the API change (PVP)

Dependencies added: stringsearch

API changes (from Hackage documentation)

- Web.Data.Stooq.API: [openint] :: StooqPrice -> Int
- Web.Data.Stooq.API: StooqPrice :: StooqSymbol -> UTCTime -> Double -> Double -> Double -> Double -> Int -> Int -> StooqPrice
+ Web.Data.Stooq.API: StooqPrice :: StooqSymbol -> UTCTime -> Double -> Double -> Double -> Double -> Int -> StooqPrice

Files

src/lib/Web/Data/Stooq/API.hs view
@@ -44,8 +44,7 @@         high    :: Double,         low     :: Double,         close   :: Double,-        volume  :: Int,-        openint :: Int+        volume  :: Int     } deriving Show  -- | Sends a request for the specified ticker and returns its latest price.@@ -70,8 +69,7 @@             high    = Impl.high row,             low     = Impl.low row,             close   = Impl.close row,-            volume  = Impl.volume row,-            openint = Impl.openint row+            volume  = Impl.volume row         }          stooqIntToDay :: Int -> Day
src/utils/Web/Data/Stooq/Internals.hs view
@@ -3,7 +3,9 @@ module Web.Data.Stooq.Internals where  import Data.Aeson (FromJSON, decode)-import Data.ByteString.Lazy.Internal (ByteString)+import Data.ByteString.Lazy (ByteString, empty)+import Data.ByteString.Char8 (pack)+import Data.ByteString.Lazy.Search (replace) import Data.Text (Text) import GHC.Generics (Generic) @@ -16,8 +18,7 @@         high    :: Double,         low     :: Double,         close   :: Double,-        volume  :: Int,-        openint :: Int+        volume  :: Int     } deriving (Show, Generic)  data StooqResponse =@@ -29,4 +30,7 @@ instance FromJSON StooqResponse  parseResponse :: ByteString -> Maybe StooqResponse-parseResponse = decode+parseResponse = decode . replace searchedSubstring replacement+    where+        searchedSubstring = pack ",\"openint\":}"+        replacement = pack "}"
stooq-api.cabal view
@@ -1,7 +1,7 @@ cabal-version:      2.0  name:               stooq-api-version:            0.2.0.0+version:            0.3.0.0 synopsis:           A simple wrapper around stooq.pl API for downloading market data. description:   Here's a simple wrapper around API offered by Stooq.pl.@@ -26,6 +26,7 @@   build-depends:      base,                       aeson,                       bytestring,+                      stringsearch,                       text,                       time   hs-source-dirs:     src/utils@@ -42,6 +43,7 @@                       utf8-string   >= 1.0.2    && < 1.1,                       vector        >= 0.12.1   && < 0.13,                       wreq          >= 0.5.3    && < 0.6,+                      stringsearch  >= 0.3      && < 0.4,                       stooq-api-utils     hs-source-dirs:   src/lib     default-language: Haskell2010