feat: pull my own artist charts
This commit is contained in:
parent
5fb630aaf8
commit
982e479812
6 changed files with 27 additions and 58 deletions
30
.github/workflows/fetch-artist-charts.yaml
vendored
30
.github/workflows/fetch-artist-charts.yaml
vendored
|
@ -1,30 +0,0 @@
|
|||
name: Fetch weekly artist charts
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '00 09 * * 5'
|
||||
jobs:
|
||||
FetchArtistCharts:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout out this repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Fetch charts
|
||||
run: |
|
||||
echo "CHART_DATA=$(curl 'https://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=coryd_&api_key=${{ secrets.LASTFM_API_KEY }}&format=json')" >> "$GITHUB_ENV"
|
||||
- name: Update charts
|
||||
run: |
|
||||
echo "CHARTS=$(cat src/_data/json/weekly-artist-charts.json | jq -c --argjson jq_data "$CHART_DATA" '.charts += [$jq_data]')" >> "$GITHUB_ENV"
|
||||
- name: Write charts
|
||||
run: |
|
||||
echo $CHARTS > src/_data/json/weekly-artist-charts.json
|
||||
- name: Commit
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Update artist charts for the week.
|
||||
commit_user_name: cdransf
|
||||
commit_user_email: coryd@hey.com
|
Reference in a new issue