Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: use preview API to fetch words #15

Open
baroxyton opened this issue Sep 11, 2022 · 4 comments
Open

Idea: use preview API to fetch words #15

baroxyton opened this issue Sep 11, 2022 · 4 comments

Comments

@baroxyton
Copy link

baroxyton commented Sep 11, 2022

as the original api has been removed the preview API could be used instead

here's a minimal demo:

token = document.cookie.split(" ").find(cookie=>cookie.includes("csrftoken")).split(/[=;]/g)[1];
response = await(await fetch("https://app.memrise.com/v1.18/learning_sessions/preview/", {
	"headers":{"Accept":"*/*","Content-Type":"Application/json","X-CSRFToken":token},
    "body": "{\"session_source_id\":2156672,\"session_source_type\":\"course_id_and_level_index\",\"session_source_sub_index\":1}",
    "method": "POST"
})).json();
console.log(response.learnables.map(learnable=>`${learnable.learning_element},${learnable.definition_element}`).join("\n"))
@raineorshine
Copy link
Owner

It works!!! Good find. Maybe I can find some time to resurrect the extension.

@raineorshine
Copy link
Owner

I played around with this some more, and it appears to only return words from in progress learning sessions. The extension needs to be able to fetch the words from an arbitrary course (i.e. the current course page, regardless if it has been studied yet or not).

@chickendude
Copy link

https://app.memrise.com/v1.18/learning_sessions/learn/?session_source_id={course_id}&session_source_sub_index={level_index}&session_source_type=course_id_and_level_index
(replace {course_id} with the course's id and {level_index} with the level you want to see)
This is what i've been using, however i just realized it seems to be limited to 10 words per level.

@baroxyton
Copy link
Author

This repository is an implementation of the api https://github.com/Eltaurus-Lt/CourseDump2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants