{"id":20619774,"url":"https://github.com/twtrubiks/auto_crawler_ptt_beauty_image","last_synced_at":"2025-06-26T10:35:29.614Z","repository":{"id":41676895,"uuid":"92665593","full_name":"twtrubiks/auto_crawler_ptt_beauty_image","owner":"twtrubiks","description":"Auto Crawler Ptt Beauty Image Use Python Schedule","archived":false,"fork":false,"pushed_at":"2024-11-30T05:01:56.000Z","size":21,"stargazers_count":37,"open_issues_count":1,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T12:16:05.483Z","etag":null,"topics":["beauty","crawler","heroku","image","ptt","python","schedule","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-28T14:17:14.000Z","updated_at":"2024-11-30T05:02:00.000Z","dependencies_parsed_at":"2025-04-15T12:12:15.865Z","dependency_job_id":"d323e31e-b7e4-4c61-9fee-f0a740e10f5a","html_url":"https://github.com/twtrubiks/auto_crawler_ptt_beauty_image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/twtrubiks/auto_crawler_ptt_beauty_image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fauto_crawler_ptt_beauty_image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fauto_crawler_ptt_beauty_image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fauto_crawler_ptt_beauty_image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fauto_crawler_ptt_beauty_image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twtrubiks","download_url":"https://codeload.github.com/twtrubiks/auto_crawler_ptt_beauty_image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fauto_crawler_ptt_beauty_image/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262049152,"owners_count":23250689,"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":["beauty","crawler","heroku","image","ptt","python","schedule","tutorial"],"created_at":"2024-11-16T12:12:29.432Z","updated_at":"2025-06-26T10:35:29.584Z","avatar_url":"https://github.com/twtrubiks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auto_crawler_ptt_beauty_image\n\nAuto Crawler Ptt Beauty Image Use Python Schedule\n\n* [Youtube Demo](https://youtu.be/IBOhQFeFDPg)\n\n本專案是經由 [PTT_Beauty_Spider](https://github.com/twtrubiks/PTT_Beauty_Spider) 小修改 + [schedule](https://github.com/dbader/schedule) 完成的。\n\n[線上 Demo 網站](https://ptt-beauty-images.herokuapp.com/)\n\n我是使用 Django 並且佈署在 [heroku](https://dashboard.heroku.com/) 上，教學以及程式碼可參考   [Deploying_Django_To_Heroku_Tutorial](https://github.com/twtrubiks/Deploying_Django_To_Heroku_Tutorial)\n\nP.S\n目前佈署在 [heroku](https://dashboard.heroku.com/) 上，因為免費版有24小時一定要休息6小時的規定，所以比較慢請多多包涵。\n\n## 特色\n\n* 每半小時自動爬取 [https://www.ptt.cc/bbs/beauty/index.html](https://www.ptt.cc/bbs/beauty/index.html) 兩頁大於 10 推的文章圖片 URL，並存到資料庫。\n* 透過 [Deploying_Django_To_Heroku_Tutorial](https://github.com/twtrubiks/Deploying_Django_To_Heroku_Tutorial) 將圖片呈現到網頁上 [Demo 網站](https://ptt-beauty-images.herokuapp.com/)。\n\n## 安裝套件\n\n確定電腦有安裝 [Python](https://www.python.org/) 之後\n\n請在  cmd (命令提示字元) 輸入以下指令\n\n```cmd\npip install -r requirements.txt\n```\n\n## schedule\n\n由於要每半小時爬取網頁一次，所以我用了 [schedule](https://github.com/dbader/schedule) , 讓程式依照我們設定的 schedule 下去執行\n\n## database 字串設定\n\n因為要佈署在 [Heroku](https://dashboard.heroku.com/)  , 所以我使用 Heroku Postgres ，\n\n詳細教學可參考 [如何在 heroku 上使用 database](https://github.com/twtrubiks/Deploying-Flask-To-Heroku#%E5%A6%82%E4%BD%95%E5%9C%A8-heroku-%E4%B8%8A%E4%BD%BF%E7%94%A8-database)\n\ndb 字串設定可在 [dbModel.py](https://github.com/twtrubiks/auto_crawler_ptt_beauty_image/blob/master/dbModel.py) 裡面設定\n\n```python\n DB_connect = 'DB URI'\n```\n\n如果你也是使用 Postgres 格式如下\n\n```python\n DB_connect = 'postgresql+psycopg2://postgres:PASSWORD@localhost/database_name'\n```\n\n## Deploy\n\n佈署空間 - [Heroku](https://dashboard.heroku.com/)\n\n教學請參考 [Deploying-Flask-To-Heroku](https://github.com/twtrubiks/Deploying-Flask-To-Heroku)\n\n因為我們這次並沒有要建立一個網站\n\n所以我們要將 [Procfile](https://github.com/twtrubiks/auto_crawler_ptt_beauty_image/blob/master/Procfile) 修改為\n\n```python\nworker: python app.py\n```\n\n## 執行環境\n\n* Python 3.9\n\n## Reference\n\n* [sqlalchemy](https://docs.sqlalchemy.org/en/14/orm/quickstart.html)\n* [schedule](https://github.com/dbader/schedule)\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%2Fauto_crawler_ptt_beauty_image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwtrubiks%2Fauto_crawler_ptt_beauty_image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwtrubiks%2Fauto_crawler_ptt_beauty_image/lists"}