+ if use_account cfg then do
+ -- use_account would be false if these fromJusts would fail.
+ cj <- make_cookie_jar
+ li_result <- log_in cj
+ (fromJust $ username cfg)
+ (fromJust $ password cfg)
+ when (not li_result) $ do
+ hPutStrLn stderr "Failed to log in."
+
+ html <- get_page (Just cj) my_article
+ print $ fromJust $ html
+ return $
+ case html of
+ Nothing -> Nothing
+ Just h -> Just $ my_read h
+ else do
+ html <- get_page Nothing my_article
+ putStrLn "Not logged in."
+ print $ fromJust $ html
+ return $
+ case html of
+ Nothing -> Nothing
+ Just h -> Just $ my_read h