chen-tf / price-tracker-bot Goto Github PK
View Code? Open in Web Editor NEWTelegram 聊天機器人,追蹤momo降價、重新上架
Home Page: https://t.me/momo_price_tracker_bot
License: MIT License
Telegram 聊天機器人,追蹤momo降價、重新上架
Home Page: https://t.me/momo_price_tracker_bot
License: MIT License
pt_repository.add_user_good_info 需替換為 SQLAlchemy 實作的方式
在 telegram bot 使用 /add 指令後可以順利將 momo 商品加入收藏,並在資料庫中查詢到對應的收藏紀錄。
Use try catch handle it. Release the lock finally.
身為 開發者
我希望 資料持久化的操作可以更簡單
如此 才可以專心在邏輯的操作上
目前的 pt_repository 使用的是 psycopg2 和他的 conneciton pool 非常的痛苦,常常會有需要自行檢查是否斷線的問題,想要直接換上一套 ORM framework 在往後的資料操作上才可以更輕鬆。
我希望 程式碼可以有統一的coding style
如此 才更容易看懂程式碼
排版三本柱都搞好了就都套用一下吧
all python file has been blacked
身為 開發者
我希望 服務狀態異常的時候收到通知
如此 我才可以緊急進行處理,避免影響到太多使用者
https://github.com/sjfbo/video-to-gif-telegram-bot/blob/master/app.py
先參考上面的 Telegram Bot 寫法, launch flask app 再透過 setWebhook 的寫法來註冊,後面接著註冊 handler。
身為 開發者
我希望 專案有足夠的測試覆蓋率
如此 才有信心相信程式的品質
現在的程式沒有任何測試覆蓋,每次的改動都像是在裸奔,無法確保品質。
身為 對這個專案有興趣的開發者
我希望 專案有清楚的 readme
如此 才可以快速地了解這個專案的背景
目前的 readme 比較像是一個故事書...,需要思考一下該做一些什麼調整,讓未來想要 fork project 的人能快速地進入狀態。
身為 開發者
我希望 main branch changed 的時候,會自動部署到對應環境
如此 我才不用手動部署
目前都是自己在 local 透過 fly.io CLI tool 的方式去部署
in pt_service.py line 83
follow_good_chat_ids = user_repository.find_all_user_by_good_id(good_id)
find_all_user_by_good_id
>> will return user list (List[User]) instead of chat_ids list (List[string])
in pt_service.py line 86
pt_bot.send( )
>> can only accept msg (string) and chat_id (string or int)
in pt_service.py line 88
str(follow_good_chat_id)
>> this will convert User in database to string.
suggest change to str(follow_good_chat_id.chat_id)
pt_repository.add_good_info 需替換為 SQLAlchemy 實作的方式
在 telegram bot 使用 /add 指令後可以順利將 momo 商品加入收藏,並在資料庫中查詢到對應的商品紀錄。
身為一個使用者
我希望可以收藏 PChome 的商品
如此我才可以更容易地以更低價格取得商品
目前是單純的 docker run,但目前我們已經備有 docker-compose 可以使用
身為 要出錢去平台開機器的苦主
我希望 notifier_web.py
和 pt_bot.py
都能使用 Flask 來接收 http request
如此 我就不用開兩台機器分別執行他們
application 可以同時接受 LINE notify & Telegram Bot Webhook
身為 專案開發者
希望 可以導入 ORM 框架
如此 才可以專心在邏輯的處理上,而不用自己一直撰寫 SQL
使用 SQLAlchemy 並改寫 pt_repository.py 中的 upsert_user 方法
身為 開發者
我希望 程式碼可以更簡潔清楚並有清楚的 module scope
如此 我才能有更好的開發效率
現況是不同 use case (瀏覽收藏、新增商品、排程檢查價格)的程式碼都摻和在一起,但每個模組間應該要符合 SRP
身為 開發者
我希望 有 formatter 可以幫助排版,讓大家的格式都可以統一
如此 協作起來才可以更順利
身為 使用者
我希望 有更多的電商平台商品可以收藏
如此 我可以有更多的機會買到便宜商品
現行只有支援 momo shop,需要知道 PChome 是否也有可以單靠 http request,不用 javascript render 就可以得到商品狀態的方法
可以透過 PChome 商品頁 URL 得到以下資訊
If we got the lock and sent request but blocked on response read for a long time. Then we can't sent any request, because the process didn't release the lock.
docker compose up
之後都可以有一個一模一樣的 PostgreSQL 環境目前為了效率考量,盡可能僅以GET response內有的資料做判斷,而不跑JS
如果有的話會加入request_html後再調整流程,render html 必須在main thread,整個執行的方式就會變成Main thread worker render html,其他地方要等call back
https://docs.python-requests.org/projects/requests-html/en/latest/
身為 開發者
我希望 pull request 有個 template
如此 我在發 PR 的時候,才知道需要提供哪些資訊給 reviewer
create pull request 的時候會出現 template
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.