fix: work on step 12

This commit is contained in:
2026-04-30 16:55:00 +02:00
parent a6033cb86a
commit 8358f9000e
15 changed files with 893 additions and 192 deletions

View File

@@ -20,7 +20,7 @@ defmodule BDS.WxrParser do
[channel] ->
%{
site: parse_site(channel),
posts: parse_items(channel, "post"),
posts: parse_post_like_items(channel),
pages: parse_items(channel, "page"),
media: parse_media(channel),
categories: parse_categories(channel),
@@ -73,6 +73,16 @@ defmodule BDS.WxrParser do
|> Enum.map(&parse_post_item/1)
end
defp parse_post_like_items(channel) do
channel
|> direct_children_named("item")
|> Enum.filter(fn item ->
type = child_text(item, "post_type")
type not in ["", "attachment", "page"]
end)
|> Enum.map(&parse_post_item/1)
end
defp parse_media(channel) do
channel
|> direct_children_named("item")