Giter Site home page Giter Site logo

fide_rs's Introduction

Unofficial FIDE Rating Scraper

This module allows you to scrape the FIDE Elo ratings of chess players, knowing their FIDE ID. It fetches the rating from the FIDE website and processes the page with regexes to extract the data. This module is extremely lightweight and doesn't require any additional modules.

If you like this module give it a star ⭐️ on GitHub.

The result is a FidePlayer object:

export interface FIDEPlayer {
    id: string;
    name: string;
    federation: string;
    country?: string;
    title?: string;
    flag?: string;
    sex: Sex;
    year: number;
    ratings: { category: Category, rating: Rating }[];
}

type Federation = string | 'FIDE';
type Rating = number | 'UNR';
type Category = 'standard' | 'blitz' | 'rapid';
type Sex = 'M' | 'F' | 'O';

The federation and country fields can hold different values.
The federation field is the country of the player or the value 'FIDE' where no federation is specified.
The country field is the 3-letter country code of the player.
The flag field is a flag emoji based on the country.
The country, title, flag fields can be undefined.
The year field is the year of birth of the player.\

Usage:

import { FIDE } from './mod.ts';

// Magnus Carlsen:
let user = await FIDE('1503014');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.