bookmark parsing lets go
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
# Something Erlang
|
||||
|
||||
## Intro
|
||||
|
||||
It's nice.
|
||||
|
||||
## Routes
|
||||
|
||||
```elixir
|
||||
@ -16,7 +20,7 @@ initial_state = %{
|
||||
%{initial_state | page_number: 23}
|
||||
```
|
||||
|
||||
## Section
|
||||
## Grover's GenServer
|
||||
|
||||
```elixir
|
||||
DynamicSupervisor.count_children(SomethingErlang.Supervisor.Grovers)
|
||||
@ -26,6 +30,8 @@ DynamicSupervisor.count_children(SomethingErlang.Supervisor.Grovers)
|
||||
SomethingErlang.Grover.mount(self(), 1, 123)
|
||||
```
|
||||
|
||||
## Client stuff
|
||||
|
||||
```elixir
|
||||
defmodule Client do
|
||||
def cookies(args) when is_map(args) do
|
||||
@ -42,5 +48,25 @@ SomethingErlang.Accounts.get_user!(1)
|
||||
|
||||
```elixir
|
||||
user = %{id: "162235", hash: "1542e8ab8b6cf65b766a32220143b97f"}
|
||||
AwfulApi.parsed_thread(3_898_279, 51, user)
|
||||
SomethingErlang.AwfulApi.parsed_thread(3_898_279, 51, user)
|
||||
```
|
||||
|
||||
<!-- livebook:{"branch_parent_index":3} -->
|
||||
|
||||
## Bookmarks
|
||||
|
||||
```elixir
|
||||
doc = SomethingErlang.AwfulApi.Client.bookmarks_doc(1, user)
|
||||
html = Floki.parse_document!(doc)
|
||||
|
||||
for td <- Floki.find(html, "tr.thread td") do
|
||||
case td do
|
||||
{"td", [{"class", <<"icon", _rest::binary>>} | _attrs], _} -> "icon"
|
||||
{"td", attrs, _} -> attrs
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
```elixir
|
||||
SomethingErlang.AwfulApi.bookmarks(user)
|
||||
```
|
||||
|
Reference in New Issue
Block a user