module Main where import Request import qualified JSONTypes as J import Torrent import qualified Data.Text as T import System.Environment main :: IO () main = do args <- getArgs case args of ([]) -> print =<< getMovies (x:xs) -> do movies <- queryMovies (T.pack x) case movies of (Left m) -> print m (Right d) -> mapM_ printMagnets (J.movies d)