-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
name: Crawler NSYSU Bus | ||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '*/5 * * * *' | ||
jobs: | ||
curl: | ||
name: Crawler and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set checkout | ||
uses: actions/checkout@v2 | ||
- name: mkdir dir | ||
run: mkdir build | ||
- run: export time=$(($(date +%s%N)/1000)) | ||
- run: echo $time | ||
- name: Instal CURL | ||
run: sudo apt install -y curl | ||
- name: Use curl download zh | ||
run: curl https://ibus.nsysu.edu.tw/API/RoutePath.aspx\?$time\&T=SC -o tmp_zh.json | ||
- name: Use curl download en | ||
run: curl 'https://ibus.nsysu.edu.tw/API/RoutePath.aspx?&C=en&T=SC' -o tmp_en.json | ||
- run: rm -f bus_info_data_zh.json | ||
- name: Use JD | ||
uses: r26d/jq-action@master | ||
with: | ||
cmd: jq -n env | ||
- name: merge zh json | ||
run: jq -s '.[0] + .[1]' bus_zh.json tmp_zh.json >> build/bus_info_data_zh.json | ||
- name: merge en json | ||
run: jq -s '.[0] + .[1]' bus_en.json tmp_en.json >> build/bus_info_data_en.json | ||
- name: Deploy | ||
run: | | ||
cd build | ||
git init | ||
git config user.name "CI" | ||
git config user.email "flutter-ci@github.com" | ||
git remote add secure-origin https://${{ secrets.ACCESS_TOKEN }}@github.com/abc873693/nsysu-bus-test.git | ||
git checkout -b gh-pages | ||
git add . | ||
git commit -m "Updated site" | ||
git push --force secure-origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"CarID":"EAA-902,EAA-903,EAL-0907,EAL-0909,","StopName":"","RouteID":50,"NameEn":"50 Wufu Main Line","isOpenData":"Y","DepartureEn":"Gushan Ferry Pier Station","DestinationEn":"Jianjun Station (MRT Weiwuying Station)"},{"CarID":"089-XH,099-XH,","StopName":"","RouteID":99,"NameEn":"NO.99","isOpenData":"Y","DepartureEn":"Cihde Temple","DestinationEn":"Former Banana Warehouse"},{"CarID":"057-FT,060-FT,129-FT,200-FV,EAL-0928,","StopName":"","RouteID":219,"NameEn":"219 A","isOpenData":"Y","DepartureEn":"Jiachang Station","DestinationEn":"Dajhih Rd. (Guangrong Elementary School)"},{"CarID":"529-FP,911-V2,","StopName":"","RouteID":248,"NameEn":"248","isOpenData":"Y","DepartureEn":"Binhai 2nd Rd.","DestinationEn":"Jianjun Station (MRT Weiwuying Station)"},{"CarID":"193-FV,532-FP,","StopName":"","RouteID":852,"NameEn":"Red 52","isOpenData":"Y","DepartureEn":"National Sun Yat-sen University","DestinationEn":"TRA New Zuoying Station"},{"CarID":"107-V3,","StopName":"","RouteID":901,"NameEn":"Orange 1 A","isOpenData":"Y","DepartureEn":"Administration Square","DestinationEn":"MRT Sizihwan Station Exit 1"},{"CarID":"667-FP,672-FP,","StopName":"","RouteID":2482,"NameEn":"248(Interval)","isOpenData":"Y","DepartureEn":"Binhai 2nd Rd.","DestinationEn":"Kaohsiung Train Station (MRT Kaohsiung Main Station)"},{"CarID":"252-FN,","StopName":"","RouteID":9012,"NameEn":"Orange 1 C","isOpenData":"Y","DepartureEn":"College of Liberal Arts","DestinationEn":"MRT Sizihwan Station Exit 2"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"CarID":"EAA-901,EAL-0901,EAL-0903,EAL-0907,EAL-0926,","StopName":"","RouteID":50,"Name":"50五福幹線","isOpenData":"Y","Departure":"鼓山輪渡站","Destination":"建軍站(捷運衛武營站)"},{"CarID":"063-XH,089-XH,","StopName":"","RouteID":99,"Name":"99","isOpenData":"Y","Departure":"慈德堂","Destination":"香蕉棚"},{"CarID":"073-FT,139-V3,EAL-0928,EAL-0952,","StopName":"","RouteID":219,"Name":"219 A","isOpenData":"Y","Departure":"大智路(光榮國小)","Destination":"加昌站"},{"CarID":"671-FP,911-V2,","StopName":"","RouteID":248,"Name":"248","isOpenData":"Y","Departure":"濱海二路","Destination":"捷運衛武營站"},{"CarID":"192-FV,193-FV,","StopName":"","RouteID":852,"Name":"紅52","isOpenData":"Y","Departure":"中山大學","Destination":"台鐵新左營站"},{"CarID":"771-FP,","StopName":"","RouteID":901,"Name":"橘1A","isOpenData":"Y","Departure":"中山大學行政大樓","Destination":"捷運西子灣1號出口"},{"CarID":"667-FP,","StopName":"","RouteID":2482,"Name":"248區間車","isOpenData":"Y","Departure":"濱海二路","Destination":"高雄火車站(捷運高雄車站)"},{"CarID":"252-FN,","StopName":"","RouteID":9012,"Name":"橘1C","isOpenData":"Y","Departure":"文學院","Destination":"捷運西子灣2號出口"}] |