Create LINE Bot with Elixir

Create LINE Bot with Elixir

Introduce my own LINE Bot created with Elixir and that's features.
tokyo.ex #2 LT Slide #beamlangtokyo
http://beam-lang.connpass.com/event/30513/

509e5167fdb3871d6b6e045e34a3e019?s=128

Takayuki Matsubara

May 23, 2016
Tweet

Transcript

  1. Create LINE Bot with Elixir

  2. self-introduction me |> name # Takayuki Matsubara |> job #

    Software Engineer |> work_at # M3, Inc. |> works # Rails, Java, JavaScript |> twitter # ma2ge |> github # ma2gedev |> oss # PowerAssertEx, breadcrumble, # chrono_logger, bundle-star, # faraday-encoding
  3. My LINE Bot(Not Public)

  4. Structure 4 Phoenix Framework 4 HTTPoison 4 PostgreSQL

  5. Features

  6. Help

  7. Run Elixir code from LINE app

  8. Implementation {result, bindings} = Code.eval_string( code, [], [file: "linebot.ex", line:

    1] ) 4 [WIP] takeover session 4 [WIP] security
  9. Pitfall !

  10. Train information

  11. 4 https://twitter.com/twcrone/status/ 574623119618535425/photo/1

  12. Implementation - Worker defmodule ZakuHead.PeriodicTask do use GenServer def start_link

    do GenServer.start_link(__MODULE__, %{}) end def init(state) do Process.send_after(self(), :work, 0) # start immediately when starting {:ok, state} end def handle_info(:work, state) do # scraping from the train information page # find some trouble routes and notify LINE BOT API Process.send_after(self(), :work, 5 * 60 * 1000) # every 5 minutes {:noreply, state} end end
  13. Implementation - Scraping 4 Floki 4 https://github.com/philss/floki

  14. jobs.m3.com/engineer/

  15. Start/Stop Zaku

  16. None
  17. None
  18. See Also if you interested in cloudBit 4 https://speakerdeck.com/ma2gedev/playing-with- littlebits-number-m3dev

  19. Light Sensor

  20. None
  21. Resources 4 LINE BOT API 4 https://developers.line.me/bot-api/overview