Skip to content

Commit

Permalink
Submit fresh data to my Datasette Cloud space
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Dec 2, 2022
1 parent 474fe6d commit 848bb7e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ jobs:
shot-scraper javascript \
"https://news.ycombinator.com/from?site=datasette.io" \
-i scrape.js -o datasette-io.json
- name: Submit fresh data to my Datasette Cloud space
env:
DS_TOKEN: ${{ secrets.SIMON_DS_WRITE_TOKEN }}
run: |-
export SIMONWILLISON_ROWS=$(
jq -n --argjson rows "$(cat simonwillison-net.json)" \
'{ "rows": $rows, "replace": true }'
)
export DATASETTE_ROWS=$(
jq -n --argjson rows "$(cat datasette-io.json)" \
'{ "rows": $rows, "replace": true }'
)
curl -X POST \
https://simon.datasette.cloud/data/hacker_news_posts/-/insert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DS_TOKEN" \
-d $SIMONWILLISON_ROWS
curl -X POST \
https://simon.datasette.cloud/data/hacker_news_posts/-/insert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DS_TOKEN" \
-d $DATASETTE_ROWS
- name: Commit and push
run: |-
git config user.name "Automated"
Expand Down

0 comments on commit 848bb7e

Please sign in to comment.