719 B
719 B
Soemthing Erlang Diagnosix
Intro
Fork this or die!
alias SomethingErlang.Accounts.User
alias SomethingErlang.Repo
alias SomethingErlang.AwfulApi.Client
:ok
%User{bbuserid: "21234"}
|> Repo.insert!()
database
for user <- Repo.all(User) do
user.email
end
client
res = Client.login()
cookies = res.headers["set-cookie"]
for cookie <- cookies, String.starts_with?(cookie, "bb"), into: %{} do
cookie
|> String.split(";", parts: 2)
|> List.first()
|> String.split("=")
|> then(fn [k, v] -> {String.to_existing_atom(k), v} end)
end