Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/scrape.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
$result | Out-File -FilePath "daily100-$date.json" -Force
popd

- name: Run Spotify app - Daily 100
- name: Run Spotify app - Melon Top 100
shell: pwsh
run: |
$appsettings = Get-Content -Path ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.sample.json | ConvertFrom-Json
Expand All @@ -77,15 +77,33 @@ jobs:
$appsettings | ConvertTo-Json -Depth 100 | Out-File -FilePath ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.json -Force

$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_PLAYLIST_ID }} --json | ConvertFrom-Json
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_PLAYLIST_ID }} --json
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_MELON_TOP100_PLAYLIST_ID }} --json | ConvertFrom-Json
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_MELON_TOP100_PLAYLIST_ID }} --json

mkdir -p ./data
pushd ./data
# $result[$($result.indexOf("{"))..$($result.Length-1)] | ConvertTo-Json -Depth 100 | Out-File -FilePath "spotify100-$date.json" -Force
$result[$($result.indexOf("{"))..$($result.Length-1)] | Out-File -FilePath "spotify100-$date.json" -Force
popd

- name: Run Spotify app - Billboard Hot 100
shell: pwsh
run: |
$appsettings = Get-Content -Path ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.sample.json | ConvertFrom-Json
$appsettings.Azure.APIM.BaseUrl = "${{ secrets.APIM_BASE_URL }}"
$appsettings.Azure.APIM.SubscriptionKey = "${{ secrets.APIM_SUBSCRIPTION_KEY }}"
$appsettings | ConvertTo-Json -Depth 100 | Out-File -FilePath ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.json -Force

$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_BILLBOARD_HOT100_PLAYLIST_ID }} --json | ConvertFrom-Json
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_BILLBOARD_HOT100_PLAYLIST_ID }} --json

mkdir -p ./data
pushd ./data
# $result[$($result.indexOf("{"))..$($result.Length-1)] | ConvertTo-Json -Depth 100 | Out-File -FilePath "billboard100-$date.json" -Force
$result[$($result.indexOf("{"))..$($result.Length-1)] | Out-File -FilePath "billboard100-$date.json" -Force
popd

- name: Upload data
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down