Support promo_video_website cards
This commit is contained in:
@@ -180,19 +180,6 @@ proc parsePhotoRail*(node: XmlNode): seq[GalleryPhoto] =
|
||||
)
|
||||
|
||||
proc parseCard*(card: var Card; node: XmlNode) =
|
||||
let cardKind = node.select("head > meta[name*=card_name]").attr("content")
|
||||
|
||||
if "summary_large_image" in cardKind:
|
||||
card.kind = summaryLarge
|
||||
elif "summary" in cardKind:
|
||||
card.kind = summary
|
||||
elif "live_event" in cardKind:
|
||||
card.kind = liveEvent
|
||||
elif "player" in cardKind:
|
||||
card.kind = player
|
||||
elif "promo_website" in cardKind:
|
||||
card.kind = promoWebsite
|
||||
|
||||
card.title = node.selectText("h2.TwitterCard-title")
|
||||
card.text = node.selectText("p.tcu-resetMargin")
|
||||
card.dest = node.selectText("span.SummaryCard-destination")
|
||||
@@ -203,9 +190,7 @@ proc parseCard*(card: var Card; node: XmlNode) =
|
||||
let image = node.select(".tcu-imageWrapper img")
|
||||
if image != nil:
|
||||
# workaround for issue 11713
|
||||
card.image = image.attr("data-src").replace("gname", "g&name")
|
||||
else:
|
||||
echo card.id
|
||||
card.image = some(image.attr("data-src").replace("gname", "g&name"))
|
||||
|
||||
if card.kind == liveEvent:
|
||||
card.text = card.title
|
||||
|
||||
Reference in New Issue
Block a user