summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 6ddae49..579ec20 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -65,7 +65,7 @@ import Options.Applicative ( Parser
)
import Prelude hiding ( takeWhile )
import Servall.Types
-import Servall.WikiParser ( parseWikiTemplates
+import Servall.WikiParser ( infobox
, wikiFilter
)
import Servant ( (:<|>)(..)
@@ -183,14 +183,7 @@ getWpSummaryFull name =
fmap (TE.decodeUtf8 . BSL.toStrict) (liftIO $ getApiWpSummary name)
getInfobox :: Text -> Handler (HM.HashMap Text Text)
-getInfobox name = do
- wiki <- getWikiFormat name
- return $ maybe
- HM.empty
- wtFields
- (find (\(WikiTemplate name _) -> name == "Infobox")
- (fromRight [] (parseWikiTemplates wiki))
- )
+getInfobox name = infobox <$> getWikiFormat name
searchYt :: Text -> Handler [Video]
searchYt query = do