27 lines
534 B
Elixir
27 lines
534 B
Elixir
defmodule SomethingErlang.AwfulApi do
|
|
require Logger
|
|
|
|
alias SomethingErlang.AwfulApi.{Client, Thread, Bookmarks}
|
|
|
|
@doc """
|
|
Returns a list of all posts on page of a thread.
|
|
|
|
## Examples
|
|
|
|
iex> t = AwfulApi.parsed_thread(3945300, 1)
|
|
iex> length(t.posts)
|
|
42
|
|
iex> t.page_count
|
|
12
|
|
"""
|
|
def parsed_thread(id, page, user) do
|
|
Client.thread_doc(id, page, user)
|
|
|> Thread.compile()
|
|
end
|
|
|
|
def bookmarks(page, user) do
|
|
Client.bookmarks_doc(page, user)
|
|
|> Bookmarks.compile()
|
|
end
|
|
end
|