+ 35

How to use Sololearn Python API within Code-Playground?

There is a Sololearn Python API on https://github.com/Tonyy18/Sololearn-API , and I would like to use it within code playground e.g. in order to search for threads dealing with "what to learn after HTML". Could somebody give me a hint to some example codes, how to apply it. I did search codes but I did not find some...

10th Nov 2020, 11:21 AM
Jan Markus
13 Réponses
+ 17
XXX It's a question that I really want to know without fun. If it is "not exactly an API" then sorry. I used this expression only because on the website I mentioned (github...) there is the title "Sololearn-API". Why should I name it different? I will try to comprehend all your answers tonight and try to get forward.
10th Nov 2020, 2:04 PM
Jan Markus
+ 15
XXX That was an affair of less than ten minutes... No, I can assure that I am not sarcastic in this thread. In others maybe, but not in this one. And I also take the right to ask questions that many people would consider easy. I've been here at the club for a long time, but I admire many here who are new to the club and who have made great strides in a short time. I assume that they simply have more free time for their hobby and can remember things better.
10th Nov 2020, 5:32 PM
Jan Markus
+ 14
XXX I understand that you are much more experienced in the field of programming, and as a layman it is sometimes difficult for me to communicate with experts/PROs like you. 🙏🙏🙏 Asking the right questions is also a matter of a certain knowledge, and mine is at best superficial knowledge.
10th Nov 2020, 2:48 PM
Jan Markus
+ 12
I am trying hard to decide whether you are just poking fun at the questions in the Q&A section (because you want threads dealing with "what to learn after HTML") or you really wanna know or both. But anyways, the mentioned repository is not exactly an API because you can't make calls to it. It is just a python code.So it cannot be used until it is available on your device. You could do something like import requests code = requests.get("https://raw.githubusercontent.com/Tonyy18/Sololearn-API/master/sl.py") code += "\nLogin(args)\n" exec(code) but that is just unnecessary hardwork. You could instead use https://github.com/Or-i0n/sololearnlib, which is a python package that can be installed. You can use it like this https://code.sololearn.com/c6V8y704xVKn/?ref=app
10th Nov 2020, 1:34 PM
XXX
XXX - avatar
+ 11
Why don't you try by importing the whole text from that "sl" file and write it into a file then use that file as a module on sololearn and use that API
10th Nov 2020, 2:47 PM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
+ 9
This is one small tutorial. https://www.dataquest.io/blog/JUMP_LINK__&&__python__&&__JUMP_LINK-api-tutorial/ The API on github says you require requests, BeautifulSoup 4 and json libraries. So you need to pip install them and probably then use the above tutorial to do something.
10th Nov 2020, 12:35 PM
Avinesh
Avinesh - avatar
+ 6
Also that code doesn't works as far as authentication is concerned ,I ran that login part of code for getting authentication token but it always returns none ,after checking source code where the url it is requesting to has no input tag with ___RequestVerificationToken and so you can't do anything with it unless there is way to post data without authentication token which I am not aware of ,best would be to use sololearnlib as mentioned by XXX!
10th Nov 2020, 1:57 PM
Abhay
Abhay - avatar
+ 6
Jan Markus "Why should I name it different?" Sorry but I didn't really understand what you are trying to ask
10th Nov 2020, 2:11 PM
XXX
XXX - avatar
+ 4
[Not an answer] Jan Markus not trying to be that guy who can't take compliments but that is too much of an overstatement (or maybe you're being sarcastic). And you call yourself layman?! You are the peron who has made the most used hacking tool on SoloLearn!
10th Nov 2020, 4:56 PM
XXX
XXX - avatar
+ 1
The SoloLearn Terms of Use state that you cannot use the service in a manner that "“crawls,” “scrapes,” or “spiders” any page, data, or portion of or relating to the Services or Content (through use of manual or automated means); ", which the library you mentioned clearly does. So, unless there is explicit clarification from moderators, i would advice you to use your own perfect tool instead
11th Nov 2020, 9:55 AM
Volodymyr Chelnokov
Volodymyr Chelnokov - avatar
0
Jan Markus can you help me ples?
30th Nov 2020, 4:59 PM
Богдан Кузів
Богдан Кузів - avatar