|
|
@@ -79,16 +79,24 @@ instance Traversable ArtDecoCardAltElement where
|
|
|
|
|
|
traverse = \x -> traverseDefault x
|
|
|
|
|
|
-queryArtDecoCardAlt :: Node → Effect (Either QueryError (ArtDecoCardAltElement Node))
|
|
|
-queryArtDecoCardAlt n = runExceptT do
|
|
|
- pvs <- runOne ":scope div.pvs-entity--padded" n
|
|
|
-
|
|
|
- bold <- runOne ":scope div.t-bold > span[aria-hidden=true]" pvs
|
|
|
+queryArtDecoCenterHeaderAlt ∷ Node → ExceptT QueryError Effect (ArtDecoCenterHeaderAlt Node)
|
|
|
+queryArtDecoCenterHeaderAlt n = do
|
|
|
+ bold <- runOne ":scope div.t-bold > span[aria-hidden=true]" n
|
|
|
normal <-
|
|
|
ignoreNotFound $
|
|
|
runOne ":scope span.t-normal:not(t-black--light) > span[aria-hidden=true]" n
|
|
|
|
|
|
- pure $ ArtDecoCardAltElement { pvs_entity: ArtDecoCenterHeaderAlt {bold, normal: normal} }
|
|
|
+ pure $ ArtDecoCenterHeaderAlt {bold, normal: normal}
|
|
|
+
|
|
|
+queryArtDecoCardAlt ∷ Node → ExceptT QueryError Effect (ArtDecoCardAltElement Node)
|
|
|
+queryArtDecoCardAlt n = do
|
|
|
+ pvs <- runOne ":scope div.pvs-entity--padded" n
|
|
|
+ header <- queryArtDecoCenterHeaderAlt pvs
|
|
|
+
|
|
|
+ pure $ ArtDecoCardAltElement { pvs_entity: header }
|
|
|
+
|
|
|
+runQuery ∷ ∀ a. ExceptT QueryError Effect a → Effect (Either QueryError a)
|
|
|
+runQuery = runExceptT
|
|
|
|
|
|
ignoreNotFound ∷ ∀ a f. Functor f ⇒ ExceptT QueryError f a → ExceptT QueryError f (Maybe a)
|
|
|
ignoreNotFound = mapExceptT (map ignoreNotFound')
|