Last active
December 11, 2023 17:32
-
-
Save dtxe/9b8e1426bf71edb1248a2f185453c2cb to your computer and use it in GitHub Desktop.
Scrape BibleProject discussion posts from YouVersion bible plans
This file contains hidden or 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
#!/bin/bash | |
PLANID=12345678 | |
JWTTOKEN={{TOKEN}} | |
for DAY in {1..365} | |
do | |
curl 'https://plans.youversionapi.com/4.0/together/$PLANID/activities?day=$DAY&page=1&order=desc&talk_it_over=0' \ | |
-H 'authority: plans.youversionapi.com' \ | |
-H 'x-youversion-app-version: 4' \ | |
-H 'x-youversion-client: youversion' \ | |
-H 'accept-language: en' \ | |
-H 'authorization: Bearer $JWTTOKEN' \ | |
-H 'content-type: application/json' \ | |
-H 'accept: application/json' \ | |
-H 'cache-control: no-cache' \ | |
-H 'x-youversion-app-platform: web' \ | |
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' \ | |
-H 'origin: https://my.bible.com' \ | |
-H 'sec-fetch-site: cross-site' \ | |
-H 'sec-fetch-mode: cors' \ | |
-H 'sec-fetch-dest: empty' \ | |
-H 'referer: https://my.bible.com/' \ | |
--compressed | |
-O $DAY.json | |
done |
Also, how did you find the "https://plans.youversionapi.com/4.0/together/$PLANID/activities?day=$DAY&page=1&order=desc&talk_it_over=0" API ?
When I use the web version, I cannot see any request to the plans.youversionapi.com domain in developer tools on Network tab...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for your answer.
So with your help, I could get my token successfully, but after updating JWTTOKEN with the value from the "yva" cookie, I still get the error message:
{"error":"access_denied","error_description":"invalid or expired token"}
Any idea?
Do you think other http headers need to be updated?