Skip to content

Commit a3be894

Browse files
authored
Automatically upload crawlers and update environment variables(Activity) (#18)
* add github action * add github action * add github action * add github action * add github action * add github action * add github action * add github action * add github action * add github action * add github action
1 parent f045ccd commit a3be894

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/daily_activity-run.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@ jobs:
2626
- name: Run daily activity script
2727
run: python crawler_testing.py
2828

29-
- name: Upload activity_result.json to remote server
30-
run: |
31-
curl -X POST ${{secrets.UPDATE_ACT_INFO_URL}} \
32-
-H "Content-Type: application/json" \
33-
--data-binary @crawler/save/activity/activity_result.json
34-
29+
- name: Upload activity_result.json to remote server
30+
run: |
31+
curl -v -X POST "${{secrets.UPDATE_ACT_INFO_URL}}?file_type=json" \
32+
-F "file=@crawler/save/activity/activity_result.json"
3533
3634
- name: Update act_info
3735
run: |
38-
curl -X POST ${{secrets.DIFY_BASE_URL}} \
36+
curl -X POST ${{secrets.DIFY_BASE_URL}}/workflows/run \
3937
--header 'Authorization: Bearer ${{secrets.UPDATE_ACT_INFO_API_KEY}}' \
4038
--header 'Content-Type: application/json' \
4139
--data-raw '{
4240
"inputs": {},
4341
"response_mode": "blocking",
42+
"user": "github"
4443
}'
4544

crawler/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
selenium
22
colorlog
33
bs4
4-
requests
4+
requests
5+
PyYAML
6+
tqdm
7+
requests

crawler_testing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ def diff_time(start, name=""):
2222
END_STR = "=END="
2323

2424
start_time = timer()
25-
activity_crawler(URL, PATH, END_STR, max_worker=0, headless=True)
25+
26+
activity_crawler(URL, PATH, END_STR, max_worker=4, headless=True)
2627
diff_time(start_time, "Code")

0 commit comments

Comments
 (0)