{"id":17286601,"url":"https://github.com/louis70109/flask-line-notify","last_synced_at":"2025-04-14T10:43:07.980Z","repository":{"id":106303913,"uuid":"241806755","full_name":"louis70109/flask-line-notify","owner":"louis70109","description":"LINE Notify + Flask 的範例專案","archived":false,"fork":false,"pushed_at":"2024-04-03T17:24:37.000Z","size":68,"stargazers_count":22,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T11:24:27.037Z","etag":null,"topics":["flask","line","line-notify","lotify"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/louis70109.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-20T06:04:41.000Z","updated_at":"2024-07-05T08:33:20.000Z","dependencies_parsed_at":"2023-11-30T08:39:12.913Z","dependency_job_id":null,"html_url":"https://github.com/louis70109/flask-line-notify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Fflask-line-notify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Fflask-line-notify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Fflask-line-notify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis70109%2Fflask-line-notify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louis70109","download_url":"https://codeload.github.com/louis70109/flask-line-notify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248867570,"owners_count":21174748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","line","line-notify","lotify"],"created_at":"2024-10-15T09:59:42.538Z","updated_at":"2025-04-14T10:43:07.956Z","avatar_url":"https://github.com/louis70109.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-LINE-notify\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Python Version](https://img.shields.io/badge/Python-%3E%3D%203.5-blue.svg)](https://badge.fury.io/py/lotify)\n\n前一陣子看到保哥寫了一篇 [LINE Notify 的文章](https://blog.miniasp.com/post/2020/02/17/Go-Through-LINE-Notify-Without-Any-Code)，詳細的介紹整個操作流程，這個專案則是去實作整個流程的範例，\n\n同時也是 [Lotify](https://github.com/louis70109/lotify) 的範例程式，歡迎大家取用試玩。\n\n# LINE Notify 註冊\n\n可以參考我之前[鐵人賽的文章](https://nijialin.com/2019/09/20/Day5-%E5%81%9A%E4%B8%80%E5%80%8B%E8%88%87-LINE-Notify-%E9%80%A3%E5%8B%95%E7%9A%84%E6%9C%8D%E5%8B%99/)。\n\n設定的 Callback Url 為 `http://YOUR_DOMAIN/callback`，本地端測試網址就為 `http://localhost:5000/callback`\n\n# GCP 一鍵佈署\n\n[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)\n\n按下上面部署按鈕之後需要設定 LINE Notify 所需三個`環境變數`\n\n![](https://i.imgur.com/jtw8KgI.png)\n\n\n# 本地端測試\n\n```sh\ncp .env.sample .env\npython api.py\n```\n\n或是\n\n```dockerfile\ncp .env.sample .env\ndocker-compose up\n```\n\n\u003e 兩個方法擇一\n\n# 步驟\n\n### [LINE Notify](https://notify-bot.line.me/zh_TW/) 基本設定\n![](https://i.imgur.com/cqmi2x0l.png)\n\n---\n\n### 初始頁面\n\n開啟瀏覽器後輸入 `http://localhost:5000` 後就會看到一個輸入按鈕\n\n![](https://i.imgur.com/u3W3jOil.png)\n\n---\n\n### 綁定通知 - 選擇`1對1聊天接收`\n![](https://i.imgur.com/bdGHOqbl.png)\n\n---\n\n### 連動完成\n這時候 LINE Notify 就會推播一個綁定成功的通知\n\n![](https://i.imgur.com/veLmsRkl.png)\n\n---\n\n### 網頁範例\n同時瀏覽器會被導到`/notify/check` 並帶上 code \u0026 state 的資訊\n![](https://i.imgur.com/XlkhJwM.png)\n\n---\n\n### 實測內容\n![](https://i.imgur.com/jf1HUqEl.png)\n---\n\n# 路由\n\n- GET /\n  - 使用者點選綁定的畫面\n- GET /callback\n  - LINE Notify 的設定以及認證完後的 callback 路由\n- 幫忙發送推播的路由(因為有[ CORS 問題](https://developer.mozilla.org/zh-TW/docs/Web/HTTP/CORS)所以需要一個 api 來幫忙轉發)\n    - POST /notify/send\n    - POST /notify/send_sticker\n    - POST /notify/send_url\n    - POST /notify/send_path\n    - POST /notify/revoke\n\n# 授權\n\n[MIT](https://github.com/louis70109/flask-line-notify/blob/master/MIT-LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis70109%2Fflask-line-notify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis70109%2Fflask-line-notify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis70109%2Fflask-line-notify/lists"}