Created
November 6, 2024 19:06
-
-
Save disconn3ct/c6354ddb4dd401c4e09a8b255d5cfad4 to your computer and use it in GitHub Desktop.
Mealie favorites sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy favorites from $ACCOUNT1 to $ACCOUNT2. No effort is made to prevent duplicates. It doesn't sync, it just copies. | |
set TOK='admin token here' | |
set ACCOUNT1='fff-fff-fff-fff-etc' | |
set ACCOUNT2='aaa-aaa-aaa-aaa-aaa' | |
set MEALIE='https://mealie.local' | |
# prints 'null' or error for each | |
curl -sSX 'GET' "$MEALIE/api/users/$ACCOUNT1/favorites" -H 'accept: application/json' -H"Authorization: Bearer $TOK" | \ | |
jq -r '.ratings[].recipeId' | while read a ; do | |
curl -sSX 'POST' "$MEALIE/api/users/$ACCOUNT2/favorites/$a" -H'accept: application/json' -H"Authorization: Bearer $TOK" | jq . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment