{"id":20619705,"url":"https://github.com/twtrubiks/line-bot-imgur-tutorial","last_synced_at":"2025-06-11T03:33:24.210Z","repository":{"id":39838770,"uuid":"99580637","full_name":"twtrubiks/line-bot-imgur-tutorial","owner":"twtrubiks","description":"透過 imgur api 製作簡單 line bot","archived":false,"fork":false,"pushed_at":"2022-06-25T04:47:13.000Z","size":15,"stargazers_count":37,"open_issues_count":0,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T11:55:08.118Z","etag":null,"topics":["flask","imgur","linebot","python","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","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/twtrubiks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-07T13:25:39.000Z","updated_at":"2024-10-04T11:42:00.000Z","dependencies_parsed_at":"2022-08-29T05:11:55.678Z","dependency_job_id":null,"html_url":"https://github.com/twtrubiks/line-bot-imgur-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fline-bot-imgur-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fline-bot-imgur-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fline-bot-imgur-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fline-bot-imgur-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twtrubiks","download_url":"https://codeload.github.com/twtrubiks/line-bot-imgur-tutorial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fline-bot-imgur-tutorial/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259191971,"owners_count":22819409,"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","imgur","linebot","python","tutorial"],"created_at":"2024-11-16T12:12:19.564Z","updated_at":"2025-06-11T03:33:24.170Z","avatar_url":"https://github.com/twtrubiks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# line-bot-imgur-tutorial\n\n透過 imgur api 製作簡單 line bot\n\n## 教學\n\n詳細 line bot 教學，請參考之前寫的  [line-bot-tutorial](https://github.com/twtrubiks/line-bot-tutorial)\n\n## 特色\n\n* 傳任意圖片給 line bot 機器人，機器人將自動幫你把圖片上傳到 imgur ( imgur 相簿可以事先定義好 )。\n* 從大家上傳的圖片中任意回傳一張圖片給使用者。\n\n## imgur  api 說明\n\n請到下方獲取自己的 CLIENT_ID , CLIENT_SECRET\n\n![alt tag](http://i.imgur.com/nQNQVD7.jpg)\n\n album_id 直接從相簿網址的最後看就可以看到了。\n\n[config.py](https://github.com/twtrubiks/line-bot-imgur-tutorial/blob/master/config.py)  裡面為自己的 imgur 的 key\n\n請記得將下方修改為自己的\n\n```python\n# imgur key\nclient_id = 'YOUR_IMGUR_CLIENT_ID'\nclient_secret = 'YOUR_IMGUR__CLIENT_SECRET'\nalbum_id = 'YOUR_IMGUR_ALBUM_ID'\naccess_token = 'YOUR_IMGUR_ACCESS_TOKEN'\nrefresh_token = 'YOUR_IMGUR_ACCESS_TOKEN'\n\n# line bot key\nline_channel_access_token = 'YOUR_CHANNEL_ACCESS_TOKEN'\nline_channel_secret = 'YOUR_CHANNEL_SECRET'\n```\n\n[auth.py](https://github.com/twtrubiks/line-bot-imgur-tutorial/blob/master/auth.py) 這支程式為取得 token ( access_token 以及 refresh_token )， 第一次執行時，需要請你輸入 pincode ，如下圖\n\n![alt tag](http://imgur.com/xRW2WAF.jpg)\n\n[upload_imgur_demo_1.py](https://github.com/twtrubiks/line-bot-imgur-tutorial/blob/master/upload_imgur_demo_1.py) 為測試  [imgurpython](https://github.com/Imgur/imgurpython) 上傳 api 簡單範例。\n\n[upload_imgur_demo_2.py](https://github.com/twtrubiks/line-bot-imgur-tutorial/blob/master/upload_imgur_demo_2.py) 為取得token ( access_token 以及 refresh_token ) 之後， 透過下方 api 上傳圖片到自己指定的相簿。\n\n( 透過 access_token 以及 refresh_token 可以不用再輸入 pincode )\n\n```python\nclient = ImgurClient(client_id, client_secret, access_token, refresh_token)\n```\n\n詳細範例可參考  [imgurpython](https://github.com/Imgur/imgurpython)，上傳範例為官方範例簡單修改。\n\n### 執行畫面\n\n請先加入好友\n\n我的 QRCODE\n\n![alt tag](http://imgur.com/P5GdOKX.jpg)\n\n或是手機直接點選  [https://line.me/R/ti/p/%40gmy1077x](https://line.me/R/ti/p/%40gmy1077x)\n\n***功能***\n\n![alt tag](http://imgur.com/tcA7GZI.jpg)\n\n![alt tag](http://imgur.com/cRdq9An.jpg)\n\n![alt tag](http://imgur.com/4oOmbB6.jpg)\n\n## 執行環境\n\n* Python 3.9\n\n## Reference\n\n* [line messaging-api](https://devdocs.line.me/en/#messaging-api)\n* [line-bot-sdk-python](https://github.com/line/line-bot-sdk-python)\n* [imgurpython](https://github.com/Imgur/imgurpython)\n\n## Donation\n\n文章都是我自己研究內化後原創，如果有幫助到您，也想鼓勵我的話，歡迎請我喝一杯咖啡:laughing:\n\n![alt tag](https://i.imgur.com/LRct9xa.png)\n\n[贊助者付款](https://payment.opay.tw/Broadcaster/Donate/9E47FDEF85ABE383A0F5FC6A218606F8)\n\n## License\n\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwtrubiks%2Fline-bot-imgur-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwtrubiks%2Fline-bot-imgur-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwtrubiks%2Fline-bot-imgur-tutorial/lists"}