twitter‎ > ‎

SearchContext

The hs-twitter search functionality is controlled by the SearchContext type, which is defined as follows:

searchFor :: SearchContext

data SearchContext
 = SearchContext
       { searchLang      :: String
       , searchRPP       :: Int
       , searchPage      :: Int
       , searchSinceId   :: StatusId
       , searchGeocode   :: String
       , searchShowUser  :: Bool
       , searchQuery     :: String
       , searchHashTag   :: String

       , searchFromUser  :: UserName
       , searchToUser    :: UserName
       , searchReferring :: UserName
       , searchAllWords  :: [String]
       , searchAnyWords  :: [String]
       , searchNoneWords :: [String]
       , searchPhrase    :: String
       , searchNear      :: String -- location name
       }

The searchFor value represent the empty, default query. Using it, you can construct new queries as follows:

new_years_resolution = searchFor{searchQuery="resolution"}
london_gigs = searchFor{searchQuery="london",searchAnyWords=["gig","concert","performance","show"]}
hash_haskell = searchFor{searchHashTag="haskell"}

Comments