The haskell-google-trends package

[Tags:library, public-domain]

[Skip to Readme]

Properties

Versions 0.0.1, 0.0.2
Dependencies base (>=4.8 && <5), bytestring, haskell-fake-user-agent (>=0.0.2), lens, regex-base, regex-posix, tagsoup, text, wreq [details]
License PublicDomain
Author grzegorzgoldapl
Maintainer contact@grzegorzgolda.com
Category Web
Home page https://github.com/grzegorzgoldapl/haskell-google-trends
Source repository head: git clone git://github.com/grzegorzgoldapl/haskell-google-trends.git
Uploaded Fri Jun 17 08:55:23 UTC 2016 by grzegorzgolda
Updated Mon Jun 20 04:22:17 UTC 2016 by grzegorzgolda to revision 1
Distributions NixOS:0.0.2
Downloads 85 total (9 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-11-23 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for haskell-google-trends

Readme for haskell-google-trends-0.0.2

GOOGLE TRENDS

Very simple library for accessing Google Trends

INSTALL

cabal install haskell-google-trends

HOW TO USE

Currently library exports two functions. Both return maybe a list of tuples of form (Year, Month, Value).

queryTrendsWithLogin :: String -> String -> Maybe (String, Int) -> String -> IO (Maybe [(Integer, String, Integer)])
queryTrendsWithLogin email password maybeProxy keywords

queryTrendsNoLogin :: Maybe (String, Int) -> String -> IO (Maybe [(Integer, String, Integer)])
queryTrendsNoLogin maybeProxy keywords

Example (No proxy):

import Google.Trends

main = do
    Just results <- queryTrendsWithLogin "your-login@gmail.com" "password" Nothing "pizza"
    print [(month, value) | (year, month, value) <- results, year == 2010]

Example (With proxy):

import Google.Trends

main = do
    Just results <- queryTrendsNoLogin (Just ("54.153.7.21", 8083)) "pizza"
    print [(month, value) | (year, month, value) <- results, year == 2010]