top of page
Search
  • benhaguenz

Getting Lichess games in Teams

I wanted to play around with getting games from LiChess and displaying them in Teams. Currently just the raw PGN.

Starting with a custom connector with this Swagger definition:


swagger: '2.0'
info: {title: Lichess Games, description: '', version: '1.0'}
host: lichess.org
basePath: /api/games/user/
schemes: [https]
consumes: []
produces: []
paths:
  /{username}:
    get:
      produces: [application/x-chess-pgn]
      responses:
        '200':
          description: OK
          schema: {type: object, title: games}
      parameters:
      - {in: path, name: username, type: string, required: true}
      - {in: query, name: max, type: integer, required: false}
      - {in: query, name: color, type: string, required: false}
      - {in: query, name: pgnInJson, type: boolean, required: false}
      operationId: GetGames
      summary: Get games of a player
definitions: {}
parameters: {}
responses: {}
securityDefinitions: {}
security: []
tags: []

The flow is basically:



and


Starts of by splitting the input using:

split(triggerOutputs()?['body/body/content'],' ')

Then check the length.

length(variables('Game Query'))

If it's three inputs assume it's ok, otherwise show the help message.

For some reason the PGN games are passed through as a Base64 encoded string in the body content variable, so use

decodeBase64(outputs('Get_games_of_a_player')?['body']['$content'])

to get the human readable version.

The result is:



3 views0 comments

Recent Posts

See All

Downloading PGN files from LiveChess Cloud

Quite a few places are using LiveChess Cloud from DGT to broadcast chess games over the internet, e.g. http://view.livechesscloud.com/ba9ad40e-88e7-491b-b48f-4efd5a761ed2 or https://view.livechessclou

A daily random XKCD in Teams

This builds on the previous post to get a random post rather than just the latest. That post can be found here: https://benhaguenz.wixsite.com/my-site/post/automatically-posting-xkcd-in-teams The firs

bottom of page