A simple side project. If you create a linebot channel which is not the type of "login", then it is not possible for us to scan the qr code via "Liff". With PIL and pyzbar, We can scan the qr code and bar code ones user send the picture in the channel. In this demonstration, We deploy the app in the heroku, so we have to add the apt option in the buildpacks of heroku dashboard. Create a file named "apt" in the root directory, and add two lines of words in the file
libzbar0
libzbar-dev
The picture user sent would save at under ./static temporarily. Heroku might clear the cache every dyno restart.(not sure)
-
A heroku app (https://dashboard.heroku.com/apps)
-
A line bot channel in line developer console
-
Enable the webhook function in your line bot channel console (https://manager.line.biz/account/[your_linebot_id]/setting)
-
Link the webhook in the line bot channel console to https://[your_app_name].herokuapp.com/callback
Copy the CHANNEL_SECRET and CHANNEL_ACCESS_TOKEN into the env config
heroku/python and https://github.com/heroku/heroku-buildpack-apt
Heroku had changed their terms of use, free Heroku Dynos are no longer available. This line-bot might not respond any more. try it out https://line.me/R/ti/p/%40127axkbn