Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Write image proxy server for LINE Bot in Go

Write image proxy server for LINE Bot in Go

Evan Lin
Chatb10ts meetup 聊天機器人小小聚 10 @ 天瓏書局 Coding Space
https://chatbots.kktix.cc/events/meetup-010

LINE Developers
PRO

June 28, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. Write image proxy server for LINE Bot in Go LINE

    Technical Evangelist Evan Lin
  2. (YDQ/LQ /,1(7HFKQLFDO(YDQJHOLVW • 'HYHORSHU 5HODWLRQV • 7HFKQLFDO EUDQGLQJ • 7HFKQLFDO

    +LULQJ • /,1( 'HYHORSHU 0HHWXS7HFK3XOVH 2UJDQL]HU
  3. NEW API Update

  4. https://developers.line.biz/en/news/#line-login-new-parameters-and-properties-added-2019-06-26

  5. https://login-tester-evan.herokuapp.com/

  6. https://www.evanlin.com/til-line-login/ Tutorial article (Chinese) Open Source Packages: • https://github.com/kkdai/line-social-sdk-go •

    https://github.com/kkdai/line-login-go
  7. Why we need a Image-Proxy Server

  8. A story about pet adoption http://www.evanlin.com/petsneedme-helping-adoption-pet/

  9. Pet Adoption : Open Data • http://data.coa.gov.tw/Service/OpenData/TransService.aspx?UnitId=QcbUEzN6E6DL&$top=50&$skip=0

  10. Pet Adoption : Open Data • http://data.coa.gov.tw/Service/OpenData/TransService.aspx?UnitId=QcbUEzN6E6DL&$top=50&$skip=0

  11. Our problem

  12. Let’s use Heroku as our Image Proxy Server • Default

    support HTTPS • No persistent storage • Will shutdown 6 hours per day (in free-tier, no prediction)
  13. Solution: Image Proxy Server

  14. Repo and how to use it https://github.com/kkdai/img-cache-server

  15. Repo and how to use it (Cont.)

  16. Demo