Skip to content

Commit

Permalink
docs: usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceh121 authored Nov 1, 2023
1 parent d69aed1 commit e956e1d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,46 @@
Unofficial Java wrapper for the new Skolengo mobility API

Part of The Rabbit Team: https://discord.gg/9u69mxsFT6

## Using
Use this [Maven repository](https://maven.vinceh121.me/#/snapshots)
```xml
<repository>
<id>vinceh121-snapshots</id>
<name>vinceh121's Maven repository</name>
<url>https://maven.vinceh121.me/snapshots</url>
</repository>
```

And add this [dependency](https://maven.vinceh121.me/#/snapshots/me/vinceh121/jskolengo/wrapper)
```xml
<dependency>
<groupId>me.vinceh121.jskolengo</groupId>
<artifactId>wrapper</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```

Example usage:
```java
JSkolengoAnonymous anon = new JSkolengoAnonymous();

// Collections by pagination, limit and offset
JSONAPIDocument<List<School>> schools = anon.searchSchools("Jules Ferry", 0, 10);
System.out.println(schools);

// Collections by iterable
for (School sch : anon.searchSchools("Jules Ferry")) {
System.out.println(sch);
}

// Collections by Java Stream
anon.searchSchools("Jules Ferry").stream().forEach(System.out::println);

// Authenticated endpoints
JSkolengo sko = new JSkolengo();
sko.setBearerToken("aaa.bbb.ccc"); // JWT access token, obtained thought OpenID Connect, see https://github.com/maelgangloff/scolengo-token
sko.setEmsCode("entmip"); // See School#getEmsCode

sko.fetchAgendas(LocalDate.now(), LocalDate.now().plusDays(14)).stream().forEach(System.out::println);
```

0 comments on commit e956e1d

Please sign in to comment.