Skip to content

Instantly share code, notes, and snippets.

@wcauchois
Created July 29, 2013 02:42
Show Gist options
  • Save wcauchois/6101884 to your computer and use it in GitHub Desktop.
Save wcauchois/6101884 to your computer and use it in GitHub Desktop.
module Main where
import Core
import Endpoint
import FoursquareEndpoint
import FoursquareModel
import GeocoderEndpoint
import GeocoderModel
targetAddress = "568 Broadway, New York, NY"
-- | The main entry point.
main :: IO ()
main =
do putStrLn "API key?"
apiKey <- getLine
putStrLn "API secret?"
apiSecret <- getLine
let creds = FoursquareCredentials apiKey apiSecret
(GeocodeResponse latLng) <- callJsonEndpoint $ GeocodeEndpoint targetAddress False
let venuesTrendingEndpoint = VenuesTrendingEndpoint latLng Nothing Nothing `authorizeWith` creds
(VenuesTrendingResponse venues) <- callJsonEndpoint venuesTrendingEndpoint
let printVenue v = putStrLn $ "- " ++ name v
mapM_ printVenue venues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment