From 6dc4856ebc2e615160dd7af2f9087e24e3a8fb9a Mon Sep 17 00:00:00 2001 From: liting Date: Sun, 24 Nov 2024 16:38:07 +0800 Subject: [PATCH] ci(actions): add schedule crawler --- .github/workflows/crawler.yml | 27 +++++++++++++++ crawler/{main.py => __main__.py} | 0 .../daily-wallpaper/2024-11-24/en-US.json | 34 +++++++++---------- 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/crawler.yml rename crawler/{main.py => __main__.py} (100%) diff --git a/.github/workflows/crawler.yml b/.github/workflows/crawler.yml new file mode 100644 index 0000000..a56a2fd --- /dev/null +++ b/.github/workflows/crawler.yml @@ -0,0 +1,27 @@ +name: Pull and commit data + +on: + workflow_dispatch: + schedule: + - cron: 0 0 * * * + +jobs: + crawler: + name: Crawler + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pipx install poetry + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'poetry' + - run: poetry install + - run: python crawler + - name: Commit and push changes + run: | + git config --global user.email "luz.liting@gmail.com" + git config --global user.name "litingyes" + git add . + git commit -m "chore: update data" + git push origin main \ No newline at end of file diff --git a/crawler/main.py b/crawler/__main__.py similarity index 100% rename from crawler/main.py rename to crawler/__main__.py diff --git a/database/bing/daily-wallpaper/2024-11-24/en-US.json b/database/bing/daily-wallpaper/2024-11-24/en-US.json index 1a326ac..735b910 100644 --- a/database/bing/daily-wallpaper/2024-11-24/en-US.json +++ b/database/bing/daily-wallpaper/2024-11-24/en-US.json @@ -1,4 +1,21 @@ [ + { + "startdate": "20241124", + "fullstartdate": "202411240800", + "enddate": "20241125", + "url": "/th?id=OHR.SonomaCoast_EN-US5218026576_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp", + "urlbase": "/th?id=OHR.SonomaCoast_EN-US5218026576", + "copyright": "Sonoma Coast State Park, California (\u00a9 Rachid Dahnoun/Tandem Stills + Motion)", + "copyrightlink": "https://www.bing.com/search?q=Sonoma+Coast+State+Park&form=hpcapt&filters=HpDate%3a%2220241124_0800%22", + "title": "Tides and twilight", + "quiz": "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20241124_SonomaCoast%22&FORM=HPQUIZ", + "wp": true, + "hsh": "3a7bb2e26badf21472319bd431911207", + "drk": 1, + "top": 1, + "bot": 1, + "hs": [] + }, { "startdate": "20241123", "fullstartdate": "202411230800", @@ -117,22 +134,5 @@ "top": 1, "bot": 1, "hs": [] - }, - { - "startdate": "20241116", - "fullstartdate": "202411160800", - "enddate": "20241117", - "url": "/th?id=OHR.FrieslandNetherlands_EN-US3770890281_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp", - "urlbase": "/th?id=OHR.FrieslandNetherlands_EN-US3770890281", - "copyright": "Wadden Sea coast, near Moddergat, Friesland, Netherlands (\u00a9 Ron ter Burg/Minden Pictures)", - "copyrightlink": "https://www.bing.com/search?q=Wadden+Sea+coast&form=hpcapt&filters=HpDate%3a%2220241116_0800%22", - "title": "Mud, sea, and sky", - "quiz": "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20241116_FrieslandNetherlands%22&FORM=HPQUIZ", - "wp": true, - "hsh": "d645b82aa2891f1ffa45b9214bc7a1b3", - "drk": 1, - "top": 1, - "bot": 1, - "hs": [] } ] \ No newline at end of file