Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SensCritique v1 deprecation warning & curl command workaround to …
…back up diary
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
> :warning: This scraper does not work anymore as SensCritique v1 ([old.senscritique.com](https://old.senscritique.com)) was shut down definitively in November 2023. The code needs to be updated for SensCritique v2, or switch to using their GraphQL API at [apollo.senscritique.com](https://apollo.senscritique.com) | ||
# go-senscritique | ||
|
||
A SensCritique web scraper. | ||
|
||
## Back up user diary via SensCritique v2 GraphQL API | ||
|
||
Set your username in `variables`. The `map` function used in the `jq` command converts the `dateDone` property from UTC to your local timezone. | ||
|
||
```sh | ||
$ curl -s -X "POST" "https://apollo.senscritique.com/" \ | ||
-H 'Content-Type: application/json; charset=utf-8' \ | ||
-d $'{ | ||
"query": "query UserDiary($isDiary:Boolean $limit:Int $offset:Int $universe:String $username:String! $yearDateDone:Int){user(username:$username){collection(isDiary:$isDiary limit:$limit offset:$offset universe:$universe yearDateDone:$yearDateDone){products{id universe category title originalTitle alternativeTitles yearOfProduction url otherUserInfos(username:$username){dateDone rating}}}}}", | ||
"variables": { | ||
"isDiary": true, | ||
"limit": 5000, | ||
"universe": null, | ||
"username": "imkh", | ||
"yearDateDone": null | ||
} | ||
}' | jq '.data.user.collection.products | map(.otherUserInfos |= (.dateDone |= (gsub("\\.\\d+Z"; "Z") | fromdateiso8601 | strflocaltime("%Y-%m-%dT%H:%M:%S %Z"))))' > "backup_senscritique_$(date '+%Y-%m-%d').json" | ||
``` |