Skip to content

Commit

Permalink
Add Getting Started section
Browse files Browse the repository at this point in the history
  • Loading branch information
ovicus committed Nov 2, 2019
1 parent db650c4 commit 37427cf
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
# ShowMyHomework .NET Core Library

[![Build Status](https://travis-ci.com/ovicus/ShowMyHomework-dotnet.svg?branch=master)](https://travis-ci.com/ovicus/ShowMyHomework-dotnet)
![Nuget](https://img.shields.io/nuget/v/Ovicus.ShowMyHomework)
![MIT](https://img.shields.io/github/license/ovicus/ShowMyHomework-dotnet)

This library allows using ShowMyHomework.co.uk API to retrieve assigned tasks.

## Getting Started
To start using `Ovicus.ShowMyHomework`, install the latest version from [Nuget](https://www.nuget.org/packages/Ovicus.ShowMyHomework/).

`PM> Install-Package Ovicus.ShowMyHomework`

To retrieve the pending tasks, create a new instance of `ShowMyHomeworkClient` and call the method `GetTodos()`.

```csharp
var client = new ShowMyHomeworkClient(accessToken);

var todos = await client.GetTodos();

foreach (var todo in todos)
{
var subject = todo.Subject;
var title = todo.Title;
var dueDate = todo.DueOn;
}
```

If you need to generate an access token, the library `Ovicus.ShowMyHomework.Auth` can help with this. Install the latest version from [Nuget](https://www.nuget.org/packages/Ovicus.ShowMyHomework.Auth/).

`PM> Install-Package Ovicus.ShowMyHomework.Auth`

```csharp
var authService = new AuthenticationService();

bool isAuthenticated = await authService.Authenticate(username, password, schoolId);

if (isAuthenticated)
{
var accessToken = await authService.GetAccessToken();
// Use the accessToken to create an instance of ShowMyHomeworkClient
}
```

You must call the `Authenticate()` method with a valid `username`, `password` and `schoolId`.

## Disclaimer
This library is not supported by ShowMyHomework.co.uk and is just the result of his author understanding about how the ShowMyHomework API works,
from observing its interactions with the public website. There is no public documentation about the API and it can change any time
Expand Down

0 comments on commit 37427cf

Please sign in to comment.