抓取 591 最新租屋資訊,並提供聊天機器人通知(可簡易的擴充)
Status page: https://zuzugo.instatus.com/
Line Notify | Slack Bot |
---|---|
- Clone 專案,然後
pnpm install
cp .env.example .env
- 更新 .env
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_REDIRECT_URI=
# 開發可以先關掉
DISABLE_CRON=true
# 記得先 createdb zuzugo-dev
DATABASE_URL=postgres://postgres@localhost:5432/zuzugo-dev?schema=public
- Primsa 相關
pnpm prisma generate
pnpm prixma migrate deploy
# start the inngest dev server
pnpm inngest-dev
- zuzugo-legacy:舊版租租狗,那時候只寫完爬蟲部分(現已失效,於是重寫),去參加 g0v 的 rentea 小聚,得知豬豬快租因為
大人的理由下架了,剛好那時程式還沒寫完就找到房子,結果儘管 README 洋洋灑灑一堆,仍舊棄坑爛尾怪 XD - https://github.com/aiyu666/rentHouse 以及各種 forks:這次重寫 zuzugo 想說也不要重造太多輪子,GitHub 搜尋 591 前幾名又是 JavaScript 就直接拿來改了。
- https://github.com/uier/rentHouse (AppLink 網址參考)
- https://github.com/zephyrxvxx7/rentHouse (591 API 修正參考)
- 豬豬快租 -> zuzu.com.tw
- bbgo -> BB 狗,雖然本專案沒有半行 Go...
- Go https://api.slack.com/apps?new_app=1 to create a new app from manifest
- Use the following manifest (TBD)
{
"display_information": {
"name": "zuzugo"
},
"features": {
"bot_user": {
"display_name": "zuzugo",
"always_online": true
},
"slash_commands": [
{
"command": "/zuzugo",
"url": "https://your-zuzugo-domain/api/slack",
"description": "zuzugo commands!",
"should_escape": false
}
]
},
"oauth_config": {
"redirect_urls": [
"https://your-zuzugo-domain/api/slack/oauth_redirect",
"https://your-zuzugo-domain/api/auth/callback/slack"
],
"scopes": {
"bot": [
"commands"
]
}
},
"settings": {
"org_deploy_enabled": false,
"socket_mode_enabled": false,
"token_rotation_enabled": false
}
}
- Go to https://your-zuzugo-domain/api/slack/install
- Click
Add to Slack channel
, select the channel you want to receive the notification - Finish Oauth login
- Check the database, you should see SlackAppInstallation table has a new record
MIT