Skip to content

Commit 4d65bbe

Browse files
authored
Update README.md
1 parent f6ab753 commit 4d65bbe

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,63 @@
55
Unofficial .NET Core Duolingo (https://www.duolingo.com/) API. Available as a [NuGet package](https://www.nuget.org/packages/DuolingoNET).
66

77
### Usage
8-
98
- Register an account on [Duolingo](https://www.duolingo.com/register).
109

11-
- Create an instance of the 'Duolingo' class and provide it with either a 'username' or 'email' and 'password'.
10+
- Create an instance of the `Duolingo` class and provide it with either a `username` or `email`, a `password` and a `HttpClient`.
1211

1312
```cs
14-
var duolingo = new Duolingo("USERNAME, PASSWORD");
13+
var duolingo = new Duolingo("USERNAME, PASSWORD", new System.Net.Http.HttpClient());
1514
```
15+
Note: a valid Duolingo account is needed to get any data from the API. If you signed in with Google you need to switch to a Duolingo account.
1616

17-
- Alternatively, it's possible to simply instantiate a new class and load the username/email and password from a JSON file 'LoginData.json' in the application folder.
17+
### Documentation
1818

19-
```javascript
20-
{
21-
"login": "USERNAME",
22-
"password": "PASSWORD"
23-
}
19+
###### Account
20+
- [Get User Data Raw](#getuserdataraw)
21+
- [Get User Info](#getuserinfo)
22+
#### GetUserDataRaw()
23+
```cs
24+
var duolingo = new Duolingo("USERNAME, PASSWORD");
25+
var userData = GetUserDataRaw();
2426
```
25-
Note: a valid account is needed to get any data from Duolingo.
27+
Returns a `User.Root` containing all the raw data for the user, as pulled by the API. Lacks ads and tracking data.
28+
#### GetUserInfo()
29+
```cs
30+
var duolingo = new Duolingo("USERNAME, PASSWORD");
31+
var userData = GetUserInfo();
32+
```
33+
Returns a `UserInfo` containing various information on the user.
2634

27-
### Documentation
2835
###### Language
29-
- [GetLearnedSkills](#getlearnedskills)
30-
- [GetKnownWords](#getknownwords)
31-
- [GetLexemeDataAsync](#getlexemedataasync)
32-
- [GetVocabularyAsync](#getvocabularyasync)
33-
#### GetLearnedSkills
36+
- [Get Learned Skills](#getlearnedskills)
37+
- [Get Known Words](#getknownwords)
38+
- [Get Lexeme Data](#getlexemedataasync)
39+
- [Get Vocabulary](#getvocabularyasync)
40+
#### GetLearnedSkills()
3441
```cs
3542
var duolingo = new Duolingo("USERNAME, PASSWORD");
3643
var skills = GetLearnedSkills();
3744
```
38-
Returns a `List<User.Skill>` containing all the skills learned (`"learned": True`) by the user.
39-
#### GetKnownWords
45+
Returns a `List<User.Skill>` containing all the skills learned within the active language(`"learned": True`) by the user.
46+
#### GetKnownWords()
4047
```cs
4148
var duolingo = new Duolingo("USERNAME, PASSWORD");
4249
var skills = GetKnownWords();
4350
```
44-
Returns a `List<string>` containing all the words known by the user.
45-
#### GetLexemeDataAsync
51+
Returns a `List<string>` containing all the words known within the active language by the user.
52+
#### GetLexemeDataAsync()
4653
```cs
4754
var duolingo = new Duolingo("USERNAME, PASSWORD");
4855
var lexeme = GetLexemeDataAsync(lexemeId);
4956
```
50-
Returns a `Lexeme.Root` representing a single word.
57+
Returns a `Task<Lexeme.Root>` representing a single word.
5158
##### Paramaters
5259
string `lexemeId` **required**
5360

5461
-- The id of the word you want to retrieve data for.
55-
#### GetVocabularyAsync
62+
#### GetVocabularyAsync()
5663
```cs
5764
var duolingo = new Duolingo("USERNAME, PASSWORD");
5865
var lexeme = GetVocabularyAsync(lexemeId);
5966
```
60-
Returns a `Vocabulary.Root` representing the user's vocabulary.
67+
Returns a `Task<Vocabulary.Root>` representing the user's vocabulary.

0 commit comments

Comments
 (0)