1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

概要

paiza.ioでelixirやってみた。
練習問題やってみた。

練習問題

qiita apiを叩いて、タイトル一覧を取得せよ。

サンプルコード

:inets.start
:ssl.start

{:ok, {_status, _headers, body}} = :httpc.request('https://qiita.com/api/v2/items?query=elixir')

body = IO.iodata_to_binary(body)
body = String.replace(body, "\\u003c", "<")
body = String.replace(body, "\\u003e", ">")
Regex.scan(~r/title\":\"(.+?)\",\"updated_at/, body)
|> Enum.map(fn [_, v] -> 
    IO.puts(v)
end)


実行結果

paiza.ioでelixir その58
paiza.ioでelixir その57
Elixirでmatch_specを使ってETS検索
paiza.ioでelixir その56
paiza.ioでelixir その55
AxonでResNet18を我流でやってみた【設計者編】
OptionParserでElixirスクリプトの引数を解析
paiza.ioでelixir その54
Elixir Axon で学ぶ機械学習 (Livebook)
Elixirで気軽にスクリプト
paiza.ioでelixir その53
paiza.ioでelixir その52
paiza.ioでelixir その50
Phoenix 1.7.0-rc.0 を楽しむ(Elixir)
Elixirで気軽にpersistent_termを使う
Elixir Nx の基礎 (Livebook)
paiza.ioでelixir その49
paiza.ioでelixir その48
paiza.ioでelixir その47
paiza.ioでelixir その46

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?