Skip to content

Scrape latest data #436

Scrape latest data

Scrape latest data #436

Workflow file for this run

name: Scrape latest data
on:
push:
workflow_dispatch:
schedule:
- cron: '12 19 * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Fetch latest data
run: |-
for LOCALE in 'au' 'ca' 'fr' 'de' 'in' 'id' 'it' 'jp' 'mx' 'ru' 'sa' 'za' 'kr' 'tr' 'gb' 'us'
do
for ENGINE in 'b' 'g' 'd' 'y' 'yt' 'br'
do
for PHRASE in 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' 'who+is+' 'how+to+b' 'how+do+' 'commonwealth+games+'
do
mkdir -p "data/$PHRASE" && curl "https://whatdoyousuggest.net/api/$ENGINE?q=$PHRASE&l=$LOCALE" | jq . > "data/$PHRASE/$ENGINE-$LOCALE.json"
done
done
done
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git pull --rebase
git push