start rewrite
This commit is contained in:
@ -1,8 +1,7 @@
|
|||||||
defmodule SomethingErlang.AwfulApi do
|
defmodule SomethingErlang.AwfulApi do
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
alias SomethingErlang.AwfulApi.Thread
|
alias SomethingErlang.AwfulApi.{Client, Thread, Bookmarks}
|
||||||
alias SomethingErlang.AwfulApi.Bookmarks
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Returns a list of all posts on page of a thread.
|
Returns a list of all posts on page of a thread.
|
||||||
@ -16,7 +15,8 @@ defmodule SomethingErlang.AwfulApi do
|
|||||||
12
|
12
|
||||||
"""
|
"""
|
||||||
def parsed_thread(id, page, user) do
|
def parsed_thread(id, page, user) do
|
||||||
Thread.compile(id, page, user)
|
Client.thread_doc(id, page, user)
|
||||||
|
|> Thread.compile()
|
||||||
end
|
end
|
||||||
|
|
||||||
def bookmarks(user) do
|
def bookmarks(user) do
|
||||||
|
@ -3,8 +3,7 @@ defmodule SomethingErlang.AwfulApi.Thread do
|
|||||||
|
|
||||||
alias SomethingErlang.AwfulApi.Client
|
alias SomethingErlang.AwfulApi.Client
|
||||||
|
|
||||||
def compile(id, page, user) do
|
def compile(doc) do
|
||||||
doc = Client.thread_doc(id, page, user)
|
|
||||||
html = Floki.parse_document!(doc)
|
html = Floki.parse_document!(doc)
|
||||||
thread = Floki.find(html, "#thread") |> Floki.filter_out("table.post.ignored")
|
thread = Floki.find(html, "#thread") |> Floki.filter_out("table.post.ignored")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user