Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 14 additions & 16 deletions .github/workflows/scrape.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
$installer = "$($playwright[0].Directory.FullName)/playwright.ps1"
& "$installer" install

- name: Run scraper app - Top 100
- name: Run Melon app - Melon Top 100
shell: pwsh
run: |
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
Expand All @@ -55,19 +55,6 @@ jobs:
$result | Out-File -FilePath "top100-$date.json" -Force
popd

- name: Run scraper app - Daily 100
shell: pwsh
run: |
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
# $result = dotnet run --project ./samples/MelonChart.ConsoleApp/ -- -c Daily100 --json | ConvertFrom-Json
$result = dotnet run --project ./samples/MelonChart.ConsoleApp/ -- -c Daily100 --json

mkdir -p ./data
pushd ./data
# $result | ConvertTo-Json -Depth 100 | Out-File -FilePath "daily100-$date.json" -Force
$result | Out-File -FilePath "daily100-$date.json" -Force
popd

- name: Run Spotify app - Melon Top 100
shell: pwsh
run: |
Expand All @@ -77,8 +64,8 @@ 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_MELON_TOP100_PLAYLIST_ID }} --json | ConvertFrom-Json
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t spotify -s ${{ secrets.SPOTIFY_MELON_TOP100_PLAYLIST_ID }} --json
# $result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t melon -s "../../data/top100-$date.json" --json | ConvertFrom-Json
$result = dotnet run --project ./samples/SpotifyPlaylist.ConsoleApp/ -- -t melon -s "../../data/top100-$date.json" --json

mkdir -p ./data
pushd ./data
Expand Down Expand Up @@ -112,3 +99,14 @@ jobs:
commit_user_name: "GitHub Actions"
commit_user_email: "scraper+github-actions[bot]@users.noreply.github.com"
commit_author: "GitHub Actions <scraper+github-actions[bot]@users.noreply.github.com>"

- name: Issue missing tracks
shell: pwsh
run: |
$date = (Get-Date).ToUniversalTime().AddHours(9).ToString("yyyyMMdd")
$collection = Get-Content "./data/spotify100-$date.json" | ConvertFrom-Json

if ($collection.missingTracks.Count -gt 0) {
$tracks = $collection.missingTracks | ConvertTo-Json -Depth 100
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"
}
Loading