Filter out ignored posts when parsing threads. Fixes #2

This commit is contained in:
Rüdiger Diedrich
2024-08-12 11:48:36 +02:00
parent 4a25eae6c6
commit 1c1d218c82

View File

@ -12,7 +12,6 @@ defmodule SomethingErlang.AwfulApi.Thread do
thread = thread =
Meeseeks.one(html, css("#thread")) Meeseeks.one(html, css("#thread"))
# Floki.find(html, "#thread") |> Floki.filter_out("table.post.ignored")
thread_id = thread_id =
Meeseeks.attr(thread, "class") Meeseeks.attr(thread, "class")
@ -37,11 +36,11 @@ defmodule SomethingErlang.AwfulApi.Thread do
end end
posts = posts =
for post <- Meeseeks.all(thread, css("table.post")) do for post <- Meeseeks.all(thread, css("table.post:not(.ignored)")) do
%{ %{
userinfo: post |> userinfo(), userinfo: userinfo(post),
postdate: post |> postdate(), postdate: postdate(post),
postbody: post |> postbody() postbody: postbody(post)
} }
end end