Skip to content

Commit 9544494

Browse files
authored
Update sample app for Spotify (#6)
1 parent 60918ce commit 9544494

File tree

12 files changed

+1154
-266
lines changed

12 files changed

+1154
-266
lines changed

.github/workflows/scrape.yaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
$installer = "$($playwright[0].Directory.FullName)/playwright.ps1"
4343
& "$installer" install
4444
45-
- name: Run scraper app - Top 100
45+
- name: Run Melon app - Melon Top 100
4646
shell: pwsh
4747
run: |
4848
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
@@ -55,19 +55,6 @@ jobs:
5555
$result | Out-File -FilePath "top100-$date.json" -Force
5656
popd
5757
58-
- name: Run scraper app - Daily 100
59-
shell: pwsh
60-
run: |
61-
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
62-
# $result = dotnet run --project ./samples/MelonChart.ConsoleApp/ -- -c Daily100 --json | ConvertFrom-Json
63-
$result = dotnet run --project ./samples/MelonChart.ConsoleApp/ -- -c Daily100 --json
64-
65-
mkdir -p ./data
66-
pushd ./data
67-
# $result | ConvertTo-Json -Depth 100 | Out-File -FilePath "daily100-$date.json" -Force
68-
$result | Out-File -FilePath "daily100-$date.json" -Force
69-
popd
70-
7158
- name: Run Spotify app - Melon Top 100
7259
shell: pwsh
7360
run: |
@@ -77,8 +64,8 @@ jobs:
7764
$appsettings | ConvertTo-Json -Depth 100 | Out-File -FilePath ./samples/SpotifyPlaylist.ConsoleApp/appsettings.Development.json -Force
7865
7966
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
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
67+
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t melon -s "../../data/top100-$date.json" --json | ConvertFrom-Json
68+
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t melon -s "../../data/top100-$date.json" --json
8269
8370
mkdir -p ./data
8471
pushd ./data
@@ -112,3 +99,14 @@ jobs:
11299
commit_user_name: "GitHub Actions"
113100
commit_user_email: "scraper+github-actions[bot]@users.noreply.github.com"
114101
commit_author: "GitHub Actions <scraper+github-actions[bot]@users.noreply.github.com>"
102+
103+
- name: Issue missing tracks
104+
shell: pwsh
105+
run: |
106+
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
107+
$collection = Get-Content "./data/spotify100-$date.json" | ConvertFrom-Json
108+
109+
if ($collection.missingTracks.Count -gt 0) {
110+
$tracks = $collection.missingTracks | ConvertTo-Json -Depth 100
111+
gh issue create --title "Missing tracks in Spotify playlist" --body "The following tracks are missing in the Spotify playlist:`r`n```````r`n$tracks`r`n```````r`n"
112+
}

0 commit comments

Comments
 (0)