Skip to content

Commit 60918ce

Browse files
authored
Update GHA workflow for daily scraping (#5)
1 parent 2abed7b commit 60918ce

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/scrape.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
$result | Out-File -FilePath "daily100-$date.json" -Force
6969
popd
7070
71-
- name: Run Spotify app - Daily 100
71+
- name: Run Spotify app - Melon Top 100
7272
shell: pwsh
7373
run: |
7474
$appsettings = Get-Content -Path ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.sample.json | ConvertFrom-Json
@@ -77,15 +77,33 @@ jobs:
7777
$appsettings | ConvertTo-Json -Depth 100 | Out-File -FilePath ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.json -Force
7878
7979
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
80-
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_PLAYLIST_ID }} --json | ConvertFrom-Json
81-
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_PLAYLIST_ID }} --json
80+
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_MELON_TOP100_PLAYLIST_ID }} --json | ConvertFrom-Json
81+
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_MELON_TOP100_PLAYLIST_ID }} --json
8282
8383
mkdir -p ./data
8484
pushd ./data
8585
# $result[$($result.indexOf("{"))..$($result.Length-1)] | ConvertTo-Json -Depth 100 | Out-File -FilePath "spotify100-$date.json" -Force
8686
$result[$($result.indexOf("{"))..$($result.Length-1)] | Out-File -FilePath "spotify100-$date.json" -Force
8787
popd
8888
89+
- name: Run Spotify app - Billboard Hot 100
90+
shell: pwsh
91+
run: |
92+
$appsettings = Get-Content -Path ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.sample.json | ConvertFrom-Json
93+
$appsettings.Azure.APIM.BaseUrl = "${{ secrets.APIM_BASE_URL }}"
94+
$appsettings.Azure.APIM.SubscriptionKey = "${{ secrets.APIM_SUBSCRIPTION_KEY }}"
95+
$appsettings | ConvertTo-Json -Depth 100 | Out-File -FilePath ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.json -Force
96+
97+
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
98+
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_BILLBOARD_HOT100_PLAYLIST_ID }} --json | ConvertFrom-Json
99+
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_BILLBOARD_HOT100_PLAYLIST_ID }} --json
100+
101+
mkdir -p ./data
102+
pushd ./data
103+
# $result[$($result.indexOf("{"))..$($result.Length-1)] | ConvertTo-Json -Depth 100 | Out-File -FilePath "billboard100-$date.json" -Force
104+
$result[$($result.indexOf("{"))..$($result.Length-1)] | Out-File -FilePath "billboard100-$date.json" -Force
105+
popd
106+
89107
- name: Upload data
90108
uses: stefanzweifel/git-auto-commit-action@v5
91109
with:

0 commit comments

Comments
 (0)